Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

1: #include <iostream>

2: #include <string.h>
3: #include <iomanip>
4: using namespace std;
5:
6: int main ()
7: {
8: int quantity,Totcust=0;
9: char menu, answer;
10: float tax,bal,amount,total,Totsale=0;
11: string TM;
12:
13:
14: cout<<"Do you want to choose a menu? (Yes = Y , No = N) : ";
15: cin>>answer;
16:
17: while (menu != 'N')
18: {
19: cout<<"Enter the type of menu ( Kids Meal = K , Snack = S , Combo = C ) : ";
20: cin>>menu;
21: cout<<"Enter the number of order : ";
22: cin>>quantity;
23:
24: if (menu == 'K')
25: {
26: TM = "Kids Meal";
27: tax = 10.5*quantity*0.05;
28: total = tax + (10.5*quantity);
29:
30: }
31: else if (menu == 'S')
32: {
33: TM = "Snack";
34: tax = 15.5*quantity*0.05;
35: total = tax + (15.5*quantity);
36:
37: }
38: else if (menu == 'C')
39: {
40: TM = "Combo";
41: tax = 18*quantity*0.05;
42: total = tax + (18*quantity);
43:
44: }
45:
46: cout<<"\n"<<endl;
47: cout<<"Total payment : RM "<<setiosflags (ios::fixed) <<setprecision(2) <<total <<endl;
48:
49: cout<<"Enter the amount for payment : RM ";
50: cin>>amount;
51:
52: bal= amount - total;
53:
54: cout<<"\n"<<endl;
55: cout<<"WELCOME TO UPIN Cafe "<<endl;
56: cout<<"*************************************************"<<endl;
57: cout<<"Type of Menu : "<<TM<<endl;
58: cout<<"Number of order(s) : "<<quantity<<endl;
59: cout<<"Total (RM) : "<<setiosflags (ios::fixed) <<setprecision(2)<<total<<endl;
60: cout<<"Cash (RM) : "<<setiosflags (ios::fixed) <<setprecision(2)<<amount<<endl;
61: cout<<"Balance (RM) : "<<setiosflags (ios::fixed) <<setprecision(2)<<bal<<endl;
62: cout<<"Thank you. Please come again. "<<endl;
63: cout<<"**************************************************"<<endl;
64: cout<<"\n"<<endl;
65:
66:
67: Totcust = Totcust + 1;
68: Totsale = Totsale + total;
69:
70: cout<<"Would you like to place another order? ( Yes = Y or No = N) ";
71: cin>>answer;
72: }
73:
74: cout<<"\nThe total sales for the day : RM"<<Totsale<<endl;
75: cout<<"The total customers for the day : "<<Totcust<<endl;
76:
77: return 0;
78: }
79:

You might also like