title: Add values to an array, print all values, and the sum of all values in an array in C#
body: <p>I want to create a loop that asks for a price and then stores that price in a new object of an array every time the iteration occurs.</p>
  
  <pre><code>double itemPrice = 0;
  double totalPrice = 0;
  const double OVER_FIFTY_DISCOUNT = .1;
  double priceSentinal = 0;
  Console.WriteLine("Please input the price of your item. Enter '0' if you have no more items.");
  itemPrice = Convert.ToDouble(Console.ReadLine());
  
  while (itemPrice != priceSentinal) 
  {
  
      Console.WriteLine("Please input the price of your item.");
      itemPrice = Convert.ToDouble(Console.ReadLine());
      double[] originalPrices = itemPrice.ToDoubleArray();
  
      if (itemPrice &gt;= 50)
      {
          itemPrice = itemPrice * OVER_FIFTY_DISCOUNT;
      }
  
      totalPrice = totalPrice + itemPrice;
      double[] allPrices = itemPrice.ToDoubleArray();  // how do I place every iteration of itemPrice
      Console.WriteLine("Your total Price is " + totalPrice); //into a new array value?
  }
  
  //How do I print every object in an array onto the screen?
  //How do I add all of the objects within an array together and print them onto the screen?
  
  Console.WriteLine("The prices of your items before discounts are " + originalPrices[]);
  Console.WriteLine("The total price of your items before discounts is " originalPrices[]);
  Console.WriteLine("The prices of your items after discounts are " + allPrices[]);
  Console.WriteLine("The total price of your items after discounts is " + allPrices[]);
  </code></pre>
  
  <p>I don't know how to add a new object to a double array for every iteration of the loop. I also don't know how to print every object within an array on to the screen, and I also don't know how to add all of the objects in an array and print them onto the screen. Could someone help me fix my code please?</p>