title: How do I record multiple inputs for 2 orders on 2 different registers?
body: <p>The tools Hal’s sells are:
      Hammers: $10.99
      Wrenches: $10.99
      Levels: $19.99
      Tape Measures: $4.99
      Screwdrivers: $8.99</p>
  
  <p>In order to make things easier in the long run you have decided to make a c++ program that takes in all the orders for each register and tallies them at the end of the day.</p>
  
  <p>Write a c++ program that does the following:</p>
  
  <ol>
  <li><p>Create a Register class that can store all of the receipts for the day and the totals for that register.</p>
  
  <p>This class could have the following member functions:</p>
  
  <p>Contructor(int) – Creates a number of receipts based on an integer that is passed into the constructor (this is the largest number of orders that the register can take).  You may also be required to create additional variables to make the program work but that’s up to you to determine.</p>
  
  <p>void getorder() – Asks the user how many of each item they want an stores that in the first available receipt.</p>
  
  <p>void returnreceipts() – This function returns the details of all the receipts and the total for the day.</p>
  
  <p>Register operator+(const Register &amp;right)- This is an overloaded addition operator.  When two objects are added together an empty temporary register is created (with 0 receipts) and only the totals of both objects are added to it.  The temporary register is returned by the function.</p>
  
  <p>Register operator=(const Register &amp;right)-  This overloaded assignment operator copies only the totals from the Object on the right.</p>
  
  <p>In the Main function I would like:</p></li>
  <li><p>Create 3 Register Objects.  The first two registers are the ones in the store and should be initialized to take 10 orders.  The third is used at closing time and can be initialized with 0 receipts as it will only take in the totals from the other registers.</p></li>
  <li>Run the getorder function for registers 1 and 2 twice.</li>
  <li>Run returnreceipts for register 1 and register2.</li>
  <li>Reg3=Reg1+Reg2;</li>
  <li>Run returnreceipts for register 3.</li>
  </ol>
  
  <p>` </p>
  
  <pre><code>  #include &lt;iostream&gt;
      #include &lt;iomanip&gt;
  
  using namespace std;
  
  class Register
  {
      public:
  
          void returnreceipts();
          void getorder();
      Register(int numReceipt)
      {
          numReceipt = reciept;
      };
      Register operator+(const Register &amp;right); //two objects are added, an empty reg is created (0 receitps)
                                                 //only the totals are added. temp reg is returned by the function
      Register operator=(const Register &amp;right); //copies only the totals fom te object on the right
  };
  
  
  int main()
  {
      Register reg1(2),reg2(2),reg3;
  
      cout &lt;&lt; "Welcome to Hardware SuperStore! I see we have a number of customers! There are two cash registers available\n" &lt;&lt; endl;
  
      reg1.getorder();
      reg2.getorder();
  
      return 0;
  }
  
  void Register::getorder()
  {
      int W,S,L,TM,H;
  
      for ( int i = 0; i &lt; 2; i++)
      {
          cout &lt;&lt; "\n";
          cout &lt;&lt; "How many of each item do you want to order for order no." &lt;&lt; i + 1 &lt;&lt; "in cash register 1 "&lt;&lt; endl;
          cout &lt;&lt; "Wrenches: ";
          cin &gt;&gt; W;
          cout &lt;&lt; endl &lt;&lt; "Screwdrivers: ";
          cin &gt;&gt; S;
          cout &lt;&lt; endl &lt;&lt; "Levels: ";
          cin &gt;&gt; L;
          cout &lt;&lt; endl &lt;&lt; "Tape Measures: ";
          cin &gt;&gt; TM;
          cout &lt;&lt; endl &lt;&lt; "Hammers: ";
          cin &gt;&gt; H;
      }
  }
  </code></pre>
  
  <p>this is what I have so far I'm trying to get the input part working first, so the user would be asked each item individual how many they want? this will happen for 2 users, then the next register will do the same? any tips will help</p>