I am writing a program for class and have no clue what I am really doing. We are talking about loops and I am assuming I need to use a loop in the program. I can get it to work as an if else program but am having trouble getting the code to not accept a negative number. any advise would be great.
here is my code
#include <iostream>
using namespace std;
int main()
{
int item, total, order;
double discount, dis;
cout << "Enter the quantity for your order ";
cin >> order;
if( order<5)
(discount = 0.0);
else if ( order >=5 && order <= 10)
(discount = .10);
else if( order > 10 && order<=20)
(discount = .15);
else if( order > 20 && order <=30)
(discount = .20);
else if( order >30)
(discount = .25);
item = 12;
dis = item-(item*discount);
cout<< "The cost per shirt is "<<dis <<".\n";
total = (item-(item *discount))*order;
cout << "Your total price is " <<total<<".\n";
system("pause");
return 0;
}