#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
char item, code [5] ;
double number, money;
const double itemA=50, itemB=60, itemC=70, disc=0.8;
const int size = 10;
cout <<"Enter the item you would like to buy: A,B, or C: ";
cin >> item;
cout <<"Enter how many you would like to buy: ";
cin >> number;
cout << "Enter the passcode: ";
cin>>code;
cout << fixed << showpoint << setprecision(2);
if (item == 'A' || item == 'B' || item == 'C')
{
if (item == 'A' && code =='DISC')
money = number * 0.8 * itemA;
cout << "Your total is $" << money;
else if (item == 'A')
money =number *itemA;
cout << "Your total is $" << money;
else if (item =='B')
money = number * itemB;
cout <<"Your total is $" << money;
else if (item =='C' && number <20)
money = number * itemC;
cout << "Your total is $" << money;
else if (item =='C' && number >20 && number <50)
money = number * 0.75 * itemC;
cout << "Your total is $" << money;
else if (item == 'C' && number >50)
money = number * 0.7 * itemC;
cout << "Your total is $" << money;
else
if (number <0)
cout << "ERROR - Not a positive amount" << endl;
else if (number >0)
cout << "ERROR - Run program again and enter item A,B,or C" << endl;
}
system ("pause");
return 0;
}
I posted what I supposed to do.