It involves discount being in a for loop.
double PRICE_PER_ITEM = 6.00;
double price;
double discount;
int[] quanLimits = { 0, 5, 10, 15 };
double[] limits = { 0, 0.10, 0.14, 0.20 };
for (int x = quanLimits.Length - 1; x >= 0; --x)
{
if (quantityOrdered >= quanLimits[x])
discount = limits[x];
}
price = quantityOrdered * PRICE_PER_ITEM;
price = price - (price * discount);
return price;
price = price - (price * discount);
is returning an error saying it is never assigned a value..?

New Topic/Question
Reply



MultiQuote




|