-
Notifications
You must be signed in to change notification settings - Fork 0
/
food.cs
103 lines (97 loc) · 3.79 KB
/
food.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication110
{
class Program
{
static int price()
{
int price;
Console.WriteLine("\nENTER THE PRICE");
price = int.Parse(Console.ReadLine());
return price;
}
static int no()
{
int no;
Console.WriteLine("\nenter total (no/plates) of (drinks/food) you want" );
no = int.Parse(Console.ReadLine());
return no;
}
static void Main(string[] args)
{
char choice;
int total;
int items;
total = 0;
int ftotal;
ftotal = 0;
int flavor;
do
{
Console.WriteLine("WHAT'S YOUR ORDER??" + "\n 1.DRINKS \n 2.FOOD");
items = int.Parse(Console.ReadLine());
int drink;
int food;
int p;
switch (items)
{
case 1:
Console.WriteLine("\nWHAT DO YOU WANNA DRINK??" + "\n 1.Soft drink \n 2.Hard drink");
drink = int.Parse(Console.ReadLine());
if (drink == 1)
{
Console.WriteLine("\n WHICH DO YOU PREFER?" + "\n 1.COKE \n 2.FANTA \n 3.SPRITE");
p = int.Parse(Console.ReadLine());
total = total + (no() * price());
}
else if (drink == 2)
{
Console.WriteLine("\n WHICH DO YOU PREFER?"+"\n 1.BEER \n 2.VODKA \n 3.RUM");
p = int.Parse(Console.ReadLine());
total = total + (no() * price());
}
else
{
Console.WriteLine("sorry");
}
break;
case 2:
Console.WriteLine("WHAT DO YOU WANNA EAT" + "\n 1.MOMO \n 2.CHOUMIN \n 3.FRENCHFRIES");
food = int.Parse(Console.ReadLine());
if (food == 1)
{
Console.WriteLine("\n WHAT FLAVOR YOU WANT TO EAT" + "\n 1.BUFF \n 2.VEG \n 3.MUTTON");
flavor = int.Parse(Console.ReadLine());
ftotal = ftotal + (no() * price());
}
else if (food == 2)
{
Console.WriteLine("\n WHAT FLAVOR YOU WANT TO EAT" + "\n 1.BUFF \n 2.VEG \n 3.MUTTON");
flavor = int.Parse(Console.ReadLine());
ftotal = ftotal + (no() * price());
}
else if (food == 3)
{
ftotal = ftotal + (no() * price());
}
else
{
Console.WriteLine("sorry");
}
break;
}
Console.WriteLine("\n ENTER capital Y IF YOU WANT TO START AGAIN \n ENTER N TO EXIT");
choice = char.Parse(Console.ReadLine());
}
while (choice == 'Y');
int sum;
sum = total + ftotal;
Console.WriteLine("\n YOU NEED TO PAY RS "+sum);
Console.ReadKey();
}
}
}