1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
#include <iostream>
using namespace std;
int main()
{
int top, ctr, order,qty, c=0.0, d=0.0,tr;
float total, amount, price,change;
string tp,flavor,flav,tpp, regular, large,select;
char r, R, L, l,y,ans, w, W, Y,ok,n;
{
do
{
system ("cls");
cout<<"-----------------MIGUELITO'S ICE CREAM-----------------"<<endl;
cout<<" ****Cashier**** "<<endl<<endl;
total=0.0;
do
{
{
cout<<" "<<"Ice Cream Cup Size: ";
cin>>select;
if (select=="regular")
{
cout<<" "<<"Flavor"<<" : ";
cin>>flavor;
cout<<" "<<"Toppings: ";
cin>>tp;
price=25;
cout<<" "<<"Price: P "<<price<<endl;
d++;
}
else if( select=="large")
{
cout<<" "<<"Flavor : ";
cin>>flav;
cout<<" "<<"Topping"<<" : ";
cin>>tpp;
price=35;
cout<<" "<<"Price: P "<<price<<endl;
c++;
}
else
{
cout<<" "<<"Invalid."<<endl;
}
cout<<endl<<endl;
total=total+price;
}
cout<<"Add order ['y for yes'| 'n'for no]: ";
cin>>ans;
cout<<endl;
}while (ans== 'y');
price=0.0;
total=total+price;
cout<<" "<<"Total: P "<<total<<endl;
cout<<" "<<"Amount: P ";
cin>>amount;
change=amount-total;
cout<<" "<<"Change: P "<<change<<endl;
cout<<"***Receipt for Printing***"<<endl<<endl<<endl;
cout<<"-----------------MIGUELITO'S ICE CREAM-----------------"<<endl;
cout<<" ****Cashier**** "<<endl<<endl;
//need your help in his part
cout<<" Items: "<<c+d<<endl;
for(ctr=1; ctr<=d; ctr++)
{
cout<<"Order"<<ctr<<": "<<select<<endl;
cout<<"Flavor"<<flavor<<endl;
cout<<"Topping"<<ctr<<": "<<tp<<endl<<endl;
}
for(tr=1; tr<=c; tr++)
{
cout<<"Order"<<ctr<<": "<<select<<endl;
cout<<"Large"<<tr<<": "<<flav<<endl;
cout<<"Topping"<<tr<<": "<<tpp<<endl<<endl;
}
cout<<" Total: P "<<total<<endl;
cout<<" Cash: P "<<amount<<endl;
cout<<" Change: P "<<change<<endl;
cout<<endl<<endl<<"-------------Thank You. Come Again.------------"<<endl<<endl<<endl;
cout<<endl<<endl<<"*********************************************"<<endl<<" Next Customer [press 'W' to continue/ 'N''to stop] "<<endl;
cin>>ans;
}while(ans == 'w' || ans == 'W');
}
return 0;
}
|