-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProject Code
472 lines (383 loc) · 13 KB
/
Project Code
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
#include <stdio.h>
#include <conio.h>
#include <string.h>
struct food_ordering {
char name[10];
int quantity;
int order_num;
int cost;
}f[500];
int order_cnt = 0, served_cnt = 0, waiting_now = 0;
int order ()
{
int n, input, qu;
printf ("Please Enter your name: ");
gets (f[order_cnt].name);
f[order_cnt].order_num = 10001+order_cnt;
items();
f[order_cnt].quantity = n;
f[order_cnt].cost = 0;
f[order_cnt].quantity = 0;
printf ("\n\nHow many items you want to order?\n");
scanf ("%d", &n);
getch ();
while (n--){
printf ("Enter the item code of the food name:\n");
scanf ("%d", &input);
getchar();
switch(input){
case 11 : {
printf ("Enter the size of Manchow soup: 1. half 2. full\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (80*qu);
else f[order_cnt].cost += (150*qu);
break;
}
case 12 :{
printf ("Enter the size of Mixed vegetable soup: 1. half 2. full\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (80*qu);
else f[order_cnt].cost += (150*qu);
break;
}
case 13 :{
printf ("Enter the size of Cream of Tomato soup: 1. half 2. full \n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (95*qu);
else f[order_cnt].cost += (190*qu);
break;
}
case 14 :{
printf ("Enter the size of Makai Shorba: 1. half 2. full\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (100*qu);
else f[order_cnt].cost += (200*qu);
break;
}
case 15 :{
printf ("Enter the size of Thick corn soup: 1. half 2. full\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (95*qu);
else f[order_cnt].cost += (190*qu);
break;
}
case 16 :{
printf ("(Veg)Manchurian\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (200*qu);
break;
}
case 17 : {
printf ("(Non-Veg)Chicken Manchurian");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (250*qu);
break;
}
case 18 : {
printf ("Spring Rolls\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (200*qu);
break;
}
case 21 : {
printf ("(Veg)Biryani\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (200*qu);
break;
}
case 22 :{
printf ("(Veg)Paneer Biryani\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (250*qu);
break;
}
case 23 :{
printf ("(Non-Veg)Chicken Biryani\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (300*qu);
break;
}
case 24 :{
printf ("(Non-Veg)Mutton Biryani\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (400*qu);
break;
}
case 25 :{
printf ("(Veg) Fried Rice\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (200*qu);
break;
}
case 31 :{
printf (" Gulab Jamun\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (90*qu);
break;
}
case 32 :{
printf (" Kala Jamun\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (90*qu);
break;
}
case 33 :{
printf (" Barfi-Kaju\n");
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
f[order_cnt].cost += (150*qu);
break;
}
case 41 :{
printf ("Enter the size of Oreo Shake: 1. mini 2. regular\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (100*qu);
else f[order_cnt].cost += (190*qu);
break;
}
case 42 :{
printf ("Enter the size of Chocolate Shake: 1. mini 2. regular\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity:\n ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (100*qu);
else f[order_cnt].cost += (190*qu);
break;
}
case 43 :{
printf ("Enter the size of Black Current Shake: 1. mini 2. regular\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (100*qu);
else f[order_cnt].cost += (190*qu);
break;
}
case 51 :{
printf ("Enter the size of Coke: 1. 250ml 2. 500ml\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (40*qu);
else f[order_cnt].cost += (80*qu);
break;
}
case 52 :{
printf ("Enter the size of Sprite: 1. 250ml 2. 500ml\n");
int i;
scanf ("%d", &i);
getchar();
printf ("Please enter the quantity: ");
scanf ("%d", &qu);
getchar();
f[order_cnt].quantity +=qu;
if (i==1) f[order_cnt].cost += (40*qu);
else f[order_cnt].cost += (80*qu);
break;
}
default : {
printf ("Invalid selection try again please\n");
n++;
}
}
}
int temp;
printf ("Choose to 1 dine here / 2 take away\n");
scanf("%d", &temp);
if (temp == 1)
printf ("We will prepare to dine here");
else
printf("We will prepare to take away");
printf ("\nTotal quantity of food ordered: %d", f[order_cnt].quantity);
printf ("\n-----------------------%s you have successfully placed the order.---------------------- ", f[order_cnt].name);
printf ("\n\nYour bill is %d rupees.\nWe request your patience while we prepare your food.\n", f[order_cnt].cost);
order_cnt ++;
}
int receive ()
{
if (order_cnt==0){
printf ("Kindly order first\n");
return;
}
else if (served_cnt == order_cnt) {
printf ("All orders are served\n");
return;
}
printf ("Order no. %d for %s is ready\n", f[served_cnt].order_num, f[served_cnt].name);
printf ("------\2Enjoy your meal\2------\n\n");
printf (" ---------Thank You---------");
served_cnt++;
}
int payment ()
{
int pay;
if (order_cnt==0){
printf ("Kindly order first\n");
return;}
printf ("Choose a number to complete the payment. \n");
printf ("You can pay your through\n 1 Cash\n 2 Debit/Credit card\n 3 UPI\n");
scanf ("%d",&pay);
if (pay == 1){
printf ("you have chosen cash payment");
}
else if (pay == 2){
printf ("you have chosen Debit/Credit payment");
}
else
printf ("you have chosen UPI payment");
printf ("\nPayment successful");
}
int display ()
{
printf ("Total order taken: %d\n", (order_cnt));
printf ("Total number of order served: %d\n", served_cnt);
printf ("Number of Currently waiting to be served: %d\n", (order_cnt-served_cnt));
printf ("Currently preparing food for order no.: %d\n\n", f[served_cnt].order_num);
printf ("------\2Thank You\2------\n");
system ("color 2");
}
void items ()
{
printf("..............MENU......................MENU.......................MENU...........................\n\n");
printf("Item Code-----Food Name ------------------------Size-------------------------Price in rupees\n");
printf("-------Soups and Starters-----\n");
printf("[11]---------Manchow Soup-----------------------half/full--------------------80/150\n");
printf("[12]---------Mixed vegetable soup---------------half/full--------------------80/150\n");
printf("[13]---------Cream of Tomato soup---------------half/full--------------------95/190\n");
printf("[14]---------Makai Shorba-----------------------half/full--------------------100/200\n");
printf("[15]---------Thick corn soup--------------------half/full--------------------95/190\n");
printf("[16]---------(Veg)Manchurian-------------------------------------------------200\n");
printf("[17]---------(Non-Veg)Chicken Manchurian-------------------------------------250\n");
printf("[18]---------(Veg)Spring Rolls-----------------------------------------------200\n");
printf("-------Main Course------------\n");
printf("[21]--------(Veg)Biriyani----------------------------------------------------200\n");
printf("[22]--------(Veg)Paneer Biryani---------------------------------------------250\n");
printf("[23]--------(Non-Veg)Chicken Biryani----------------------------------------300\n");
printf("[24]--------(Non-Veg)Mutton Biryani------------------------------------------400\n");
printf("[25]--------(Veg)Fried Rice--------------------------------------------------200\n");
printf("-------Desserts---------------\n");
printf("[31]---------Gulab Jamun-----------------------------------------------------90\n");
printf("[32]---------Kala Jamun------------------------------------------------------90\n");
printf("[33]---------Barfi-kaju------------------------------------------------------150\n");
printf("-------Milkshakes-------------\n");
printf("[41]---------Oreo Shake-------------------------mini/regular-----------------100/190\n");
printf("[42]---------Chocolate Shake--------------------mini/regular-----------------100/190\n");
printf("[43]---------Black Current Shake----------------mini/regular-----------------100/190\n");
printf("-------Beverages--------------\n");
printf("[51]---------Coke-------------------------------250ml/500ml------------------40/80\n");
printf("[52]---------Sprite-----------------------------250ml/500ml------------------40/80\n");
}
int main ()
{
printf (" Welcome To Programmed Menu \n\n");
printf("Choose a number to start");
while (1){
printf ("\n 1 Order\n 2 Payment\n 3 Serve\n 4 Display\n 5 Exit\n");
int input;
scanf ("%d", &input);
getchar ();
switch (input){
case 1 : {
order ();
break;
}
case 2 : {
payment();
break;
}
case 3 : {
receive();
break;
}
case 4 : {
display();
break;
}
case 5 : {
system ("COLOR 3");
printf ("....\2 Thank you Visit again \2....\n\n");
return 0;
}
}
}
}