title: Correctly deducting a discount from a total price?
body: <p>I have this code that takes in a number for a quantity of items. Each item has a base price of $6.00, then there is a discount applied to it based on the  number of items,1-4 items have no discount, 5-9 has a 10% discount, 10-14 get a 14% discount, and 15 or more get a 20% discount. I ran the program but it seems to be outputting the final price without the discount deducted from the total price. What am I doing wrong? </p>
  
  <pre><code> static void Main(string[] args)
      {
          int quantity;
          double price;
          quantity = GetQuantity();
          price = CalculatePrice(quantity);
          WriteLine("Final price for {0} items is {1}.",
            quantity, price.ToString("c"));
  
      }
  
      private static int GetQuantity()
      {
          int quantity;
          Write("Enter number of items &gt;&gt; ");
          quantity = Convert.ToInt32(ReadLine());
          return quantity;
  
      }
      private static double CalculatePrice(int quantityOrdered)
      {
          double PRICE_PER_ITEM = 6.00;
          double price = 0;
          double discount = 0;
          int[] quanLimits = { 0, 5, 10, 15 };
          double[] limits = { 0, 0.10, 0.14, 0.20 };
          for (int x = limits.Length - 1; x &gt;= 0; x--)
              if (quantityOrdered &gt;= quanLimits[x])
                  discount = limits[x];
          //int x = 0;
          price = quantityOrdered * PRICE_PER_ITEM;
          price = price - (price * discount);
          return price;
      }
  </code></pre>