-
Notifications
You must be signed in to change notification settings - Fork 21
/
PrintMenu.java
80 lines (50 loc) · 1.14 KB
/
PrintMenu.java
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
import java.util.Scanner;
public class PrintMenu {
public static void main(String[] args) {
int cheeze = 2;
int taco = 5;
int soda = 4;
int salsa = 20;
int mayo = 17;
int butter = 900;
int count = 0;
int choice = 0;
int sum = 0;
Scanner input = new Scanner(System.in);
while (choice !=7) {
System.out.println("select a option");
System.out.println("1) cheeze cost 2 bucks");
System.out.println("2) taco cost 5 bucks");
System.out.println("3) soda cost 4 bucks");
System.out.println("4) salsa cost 20 bucks");
System.out.println("5) mayo cost 17 bucks");
System.out.println("6) butter cost 900 bucks");
System.out.println("7) exit menu");
choice = input.nextInt();
System.out.println("choose now");
switch(choice){
case 1:
sum += cheeze;
break;
case 2:
sum += salsa;
break;
case 3:
sum += taco;
break;
case 4:
sum +=soda;
break;
case 5:
sum += mayo;
break;
case 6:
sum += butter;
break;
case 7:
System.out.printf("ur total is " + sum + " bucks");
break;
}
}
}
}