-
Notifications
You must be signed in to change notification settings - Fork 0
/
#14 food_menu.cpp
56 lines (46 loc) · 1.04 KB
/
#14 food_menu.cpp
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
/* Q)Create a Fast Food
Menu using switch case. */
#include<iostream>
using namespace std;
int main()
{
int num, cost;
char choice;
cout<<"***FAST FOOD MENU***"<<endl;
cout<<"a- Fries($2)"<<endl;
cout<<"b- Chicken Wrap($5)"<<endl;
cout<<"c- Cheeseburger($10)"<<endl;
cout<<"d- Pizza($15)"<<endl;
cout<<"Select a choice [a-d]: ";
cin>>choice;
switch(choice)
{
case 'a':
cout<<"How many Fries you want? ";
cin>>num;
cost = num*2;
cout<<"Cost of your Fries is: $"<<cost;
break;
case 'b':
cout<<"How many Chicken Wrap you want? ";
cin>>num;
cost = num*5;
cout<<"Cost of your Chicken Wrap is: $"<<cost;
break;
case 'c':
cout<<"How many Cheeseburger you want? ";
cin>>num;
cost = num*10;
cout<<"Cost of your Cheeseburger is: $"<<cost;
break;
case 'd':
cout<<"How many Pizza you want? ";
cin>>num;
cost = num*15;
cout<<"Cost of your Pizza is: $"<<cost;
break;
default:
cout<<"Invalid Choice";
}
return 0;
}