-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBobaShop.java
More file actions
109 lines (100 loc) · 4.13 KB
/
BobaShop.java
File metadata and controls
109 lines (100 loc) · 4.13 KB
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
import java.util.Scanner;
public class BobaShop {
public static void main(String[] args) {
Scanner userInput;
int text; //the text the user inputs will be a string
String bobaShop;
userInput = new Scanner(System.in); //create scanner object called userInput where user will input their stuff
System.out.print("What is your desired zipcode? "); // ask what their zipcode is
text = userInput.nextInt(); //the text the userinputs will be in the next line
switch (text)
{ case 30309:
bobaShop = "Sweet Hut";
System.out.println("There is a bubble tea shop called " + bobaShop + " here!");
System.out.print("Enter your budget: ");
int budget = userInput.nextInt();
if (budget <= 10 && budget >= 1) {
System.out.println("You can purchase 2 drinks.");
}
else if (budget <= 20 && budget >= 11) {
System.out.println("You can purchase 4 drinks.");
}
else if (budget <= 40 && budget >=21) {
System.out.println("You can purchase 8 drinks.");
}
else if (budget > 40) {
System.out.println("You can purchase 20 drinks.");
}
else {
System.out.println("Invalid.");
}
break;
case 30308:
bobaShop = "Tea Corner";
System.out.println("There is a bubble tea shop called " + bobaShop + " here!");
System.out.print("Enter your budget: ");
budget = userInput.nextInt();
if (budget <= 10 && budget >=1) {
System.out.println("You can purchase 2 drinks.");
}
else if (budget <= 20 && budget >=11) {
System.out.println("You can purchase 4 drinks.");
}
else if (budget <= 40 && budget >=21) {
System.out.println("You can purchase 8 drinks.");
}
else if (budget > 40) {
System.out.println("You can purchase 20 drinks.");
}
else {
System.out.println("Invalid.");
}
break;
case 30306:
bobaShop = "Honey Bubble";
System.out.println("There is a bubble tea shop called " + bobaShop + " here!");
System.out.print("Enter your budget: ");
budget = userInput.nextInt();
if (budget <= 10 && budget >=1) {
System.out.println("You can purchase 2 drinks.");
}
else if (budget <= 20 && budget >=11) {
System.out.println("You can purchase 4 drinks.");
}
else if (budget <= 40 && budget >=21) {
System.out.println("You can purchase 8 drinks.");
}
else if (budget > 40) {
System.out.println("You can purchase 20 drinks.");
}
else {
System.out.println("Invalid.");
}
break;
case 30360:
bobaShop = "Tea Corner";
System.out.println("There is a bubble tea shop called " + bobaShop + " here!");
System.out.print("Enter your budget: ");
budget = userInput.nextInt();
if (budget <= 10 && budget >=1) {
System.out.println("You can purchase 2 drinks.");
}
else if (budget <= 20 && budget >=11) {
System.out.println("You can purchase 4 drinks.");
}
else if (budget <= 40 && budget >=21) {
System.out.println("You can purchase 8 drinks.");
}
else if (budget > 40) {
System.out.println("You can purchase 20 drinks.");
}
else {
System.out.println("Invalid.");
}
break;
default:
System.out.println("Sorry, no shops found.");
break;
}
}
}