-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode
52 lines (42 loc) · 1.3 KB
/
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
using System;
class Program
{
static void Main()
{
int totalprice = 0;
start:
Console.WriteLine("select coffie 1 =small, 2= normal 3=large");
int usernum =int.Parse(Console.ReadLine());
switch (usernum)
{
case 1:
totalprice += 1;
break;
case 2:
totalprice += 2;
break;
case 3:
totalprice += 3;
break;
default:
Console.WriteLine("invalid selection");
Console.ReadLine();
goto start;
}
decide:
Console.WriteLine("you need another cup? yes or no");
String xxx = Console.ReadLine();
switch (xxx)
{
case "yes":
goto start;
case "no":
break;
default:
Console.WriteLine("invalid selection");
goto decide;
}
Console.WriteLine("total bill = {0}", totalprice * 100);
Console.ReadLine();
}
}