title: Accumulating multiple totals
body: <p>I have just started to learn looping, and I don't understand how to accumulate more than one total in my output using a <code>for</code> or <code>while</code> statement. </p>
  
  <p>My code is meant to represent three families (A, B and C) having a garage sale. When they enter their initials, they can enter an amount of a sale. They can add as many amounts as they want, and when they want to see their total, they press <kbd>Z</kbd> and it will display each family's total, as well as a grand total made at the garage sale.</p>
  
  <p>I can't figure out how to show all the totals though. How should I go about this?</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>static void Main(string[] args)
  {
      double totalFamilyA;
      double totalFamilyB;
      double totalFamilyC;
      double grandTotal = 0;
      double saleAmount;
      string familyInitial;
      string inputSale;
      Console.Write("Enter your family initial A, B, or C (uppercase/lowercase accepted) ");
      familyInitial = Console.ReadLine();
      Console.Write("Enter sale amount $");
      inputSale = Console.ReadLine();
      saleAmount = Convert.ToDouble(inputSale);
  
      while (familyInitial != "Z" &amp;&amp; familyInitial != "z")
      {
          totalFamilyA = Convert.ToDouble(inputSale);
          totalFamilyB = Convert.ToDouble(inputSale);
          totalFamilyC = Convert.ToDouble(inputSale);
          if (familyInitial == "A" || familyInitial == "a")
          {
              totalFamilyA += saleAmount;
              Console.Write("Enter next sale amount or press 'Z' or 'z' to see the grand total $");
              inputSale = Console.ReadLine();
              saleAmount = Convert.ToDouble(inputSale);
              totalFamilyA = Convert.ToDouble(saleAmount);
          }
          else if (familyInitial == "B" || familyInitial == "b")
          {
              totalFamilyB += saleAmount;
              Console.Write("Enter next sale amount or press 'Z' or 'z' to see the grand total $");
              inputSale = Console.ReadLine();
              saleAmount = Convert.ToDouble(inputSale);
              totalFamilyB = Convert.ToDouble(saleAmount);
          }
          else if (familyInitial == "C" || familyInitial == "c")
          {
              totalFamilyC += saleAmount;
              Console.Write("Enter next sale amount or press 'Z' or 'z' to see the grand total $");
              inputSale = Console.ReadLine();
              saleAmount = Convert.ToDouble(inputSale);
              totalFamilyC = Convert.ToDouble(saleAmount);
          }
      }
      Console.WriteLine("Your total is {0}", grandTotal.ToString("C"));
  }
  </code></pre>