My program is supposed to calculate the price of items (customers get a discount off regular price of the item if they purchase 10 or more of the item). It's all working well except for the int Product::fulfillOrder(int orderq)
function. It says a value must be returned, but the orderq
should be returning a value for the function to use (I believe I did it right). Here's the code for the problem function:
int Product::fulfillOrder(int orderq)
{
if (orderq < 0)
{
cout << "Error" << endl;
orderq = 0;
cout << "Shipped: " << orderq << endl;
}
else if (orderq <= Quantity)
{
orderq = Quantity;
Quantity -= orderq;
cout << "Shipped: " << orderq << endl;
}
else
{
orderq = Quantity;
orderq = 0;
cout << "Shipped: " << orderq << endl;
}
}