A stationary store uses a system to generate the customer purchase amount. The cashier needs to key in the item code and item quantity. Then, the system calculates the purchase amount and generate a receipt for the customer. Information on item code, item name, item description, item quantity, item price and purchase amount will be printed on the receipt.
#include <iostream>
using namespace std;
int main()
{
int code, qty, amount;
char name[100];
cout << "\t\t*****************************" << endl;
cout << "\t\t\tStationary store" << endl;
cout << "\t\t*****************************" << endl;
cout<<"Key in the item code: "<<endl;
cin>>code;
cout<<"Key in the item quantity: "<<endl;
cin>>qty;
if(code==5070)
{
amount=60*qty;
cout<<"Receipt on the item purchased"<<endl;
cout<<"The item code: "<<code<<endl;
cout<<"Item name: Calculator"<<endl;
cout<<"Item description: FC-100 Financial calculator. Brand: Casio, Type: Financial. Power source: Battery/Solar."<<endl;
cout<<"Item quantity: "<<qty<<endl;
cout<<"Item price: $60"<<endl;
cout<<"Purchase Amount:$ "<<amount<<endl;
cout<<"--------------------------------"<<endl;
}
else if (code==2030)
{
amount=5*qty;
cout<<"Receipt on the item purchased"<<endl;
cout<<"The item code: "<<code<<endl;
cout<<"Item name: Counter Book"<<endl;
cout<<"Item description: Counter Book 6 QUIRE, Size A4 Pages 576, Ref No 236"<<endl;
cout<<"Item quantity: "<<qty<<endl;
cout<<"Item price: $4"<<endl;
cout<<"Purchase Amount:$ "<<amount<<endl;
cout<<"--------------------------------"<<endl;
}
else if (code==1040)
{
amount=9*qty;
cout<<"*******Receipt*********"<<endl;
cout<<"The item code: "<<code<<endl;
cout<<"Item name: Graphic Pencil"<<endl;
cout<<"Item description: Staedtler Lumograph Graphite Drawing And Sketching Pencil set of 6 degrees"<<endl;
cout<<"Item quantity: "<<qty<<endl;
cout<<"Item price: $9"<<endl;
cout<<"Purchase Amount:$ "<<amount<<endl;
cout<<"--------------------------------"<<endl;
}
else
{
cout<<"Invalid item code"<<endl;
}
return 0;
}
Comments
Leave a comment