Can anyone help me with this:
I made a program where the user will choose a product from a menu and i want after the products that the user chosen will be output also below where there is like a "receipt-like" or a summary of what the user bought. I have another post with this code but it seems that the title before was not appropriate. Im out of idea.
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
char *kinds[5] = {" Chocolate Cake"," Cheese Cake"," Pandan Cake"," Fruit Cake"," Banana Cake"},pitz;
int order1=0,order2=0,order3=0,order4=0,order5=0,quantity,cake,chocake=240,checake=230,pandcake=270,fruicake=300,banacake=220;
float payable=0,cash,price,change,total1=0,total2=0,total3=0,total4=0,total5=0,sum = 0,n;
system ("color F2");
cout<<"\a\t\t\t -Welcome to Rigz Cakeshop-\n"<<endl;
cout<<"\tPlease choose your order: "<<endl;
cout<<"\n\t\t 1)Chocolate Cake P240.00";
cout<<"\n\t\t 2)Cheese Cake P230.00";
cout<<"\n\t\t 3)Pandan Cake P270.00";
cout<<"\n\t\t 4)Fruit Cake P300.00";
cout<<"\n\t\t 5)Banana Cake P220.00";
cout<<endl;
do {
cout<<"\n\t\t Please choose your order from the list: ";
cin>>cake;
payable=payable+total1;
switch (cake) {
case 1:
cout<<"\n\tYou ordered for:"<<kinds[0]<<endl;
cout<<"\tPrice: P"<<chocake<<endl;
cout<<"\tHow many: ";
cin>>order1;
total1=chocake*order1;
cout<<"\tTotal: P"<<total1<<endl;
break;
case 2:
cout<<"\n\tYou ordered for:"<<kinds[1]<<endl;
cout<<"\tPrice: P"<<checake<<endl;
cout<<"\tHow many: ";
cin>>order2;
total2=checake*order2;
cout<<"\tTotal: P"<<total2<<endl;
break;
case 3:
cout<<"\n\tYou ordered for:"<<kinds[2]<<endl;
cout<<"\tPrice: P"<<pandcake<<endl;
cout<<"\tHow many: ";
cin>>order3;
total3=pandcake*order3;
cout<<"\tTotal: P"<<total3<<endl;
break;
case 4:
cout<<"\n\tYou ordered for:"<<kinds[3]<<endl;
cout<<"\tPrice: P"<<fruicake<<endl;
cout<<"\tHow many: ";
cin>>order4;
total4=fruicake*order4;
cout<<"\tTotal: P"<<total4<<endl;
break;
case 5:
cout<<"\n\tYou ordered for:"<<kinds[4]<<endl;
cout<<"\tPrice: P"<<banacake<<endl;
cout<<"\tHow many: ";
cin>>order5;
total5=banacake*order5;
cout<<"\tTotal: P"<<total5<<endl;
break;
default:
cout<<"\a\n\n\t\t\tSorry it is not available here."<<endl<<endl;
char f;
cout<<"\tWould you like to reset the program to choose order again? (Y or N): ";
cin>>f;
system("cls");
if((f=='Y')||(f=='y')) {
WinExec("a-piece-of-cake.exe", SW_SHOW);
exit(1);
} else {
return(0);
}
break;
}
cout << "\n\t\t\tDo you want to order another (y/n)? ";
cin >> pitz;
}
while ((pitz == 'y')||(pitz == 'Y'));
payable=payable+total1+total2+total3+total4+total5;
cout<<"\n\tAmount to be paid: P"<<payable;
do {
cout<<"\n\tYour cash is: P";
cin>>cash;
if (cash<payable){
cout<<"\a\n\t\t\t Your money is not enough. "<<endl;
}
}
while (cash<payable);
change=cash-payable;
cout<<"\n\tYour change is: P"<<change<<"\n\n"<<endl<<endl;
cout<<"\t\t For your receipt: ";
system("pause");
system("cls");
system("color E0");
cout<<"\t\t\t O F F I C I A L R E C E I P T"<<endl;
cout<<"\n\t\t\t -Rigz Cakeshop-\n";
cout<<"\n\tYou ordered for numbers: ";
quantity=order1+order2+order3+order4+order5;
cout<<"\n\tTotal quantity: "<<quantity;
cout<<"\t\t\t\t Cash: P"<<cash;
cout<<"\n\tTotal: P"<<payable;
cout<<"\t\t\t\t\t Change: P"<<change;
cout<<"\a\n\t\t\t Thank you,please come again!"<<endl;
cout<<"\n\tAlso try our other cakes. "<<endl;
cout<<"\n\t\t 1)Chocolate Cake P240.00";
cout<<"\n\t\t 2)Cheese Cake P230.00";
cout<<"\n\t\t 3)Pandan Cake P270.00";
cout<<"\n\t\t 4)Fruit Cake P300.00";
cout<<"\n\t\t 5)Banana Cake P220.00"<<endl;
cout<<"\n\n\t*We accept all kinds of occasions"<<endl;
cout<<"\tFor *orders *comments or *suggestions please contact: 09169475449"<<endl;
cout<<"\tEmail @: rigorcadiz@yahoo.com"<<endl;
cout <<"\n\tTime: "<<__TIME__;
cout<<"\t\t\t\tCreated by: Rigor N. Cadiz";
cout<<"\n\tDate: "<<__DATE__<<endl;
getchar();
cin.get();
}