-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRestaurantAdvisor.java
181 lines (164 loc) · 8.91 KB
/
RestaurantAdvisor.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
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
import java.util.Scanner;
public class RestaurantAdvisor {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Ask user for preferences
System.out.println("Welcome to the Birmingham Restaurant Advisor!");
System.out.println("Please answer a few questions to help us suggest a restaurant for you.");
// Default value
String cuisineType = "mexican";
Boolean validInput = false;
// Loops until user's input is valid (Mexican, Italian, Chinese, Indian, Fast Food, BBQ, Breakfast, Sandwiches)
while (!validInput){
System.out.print("What type of cuisine are you in the mood for? (Mexican, Italian, Chinese, Indian, Fast Food, BBQ, Breakfast, Sandwiches): ");
cuisineType = scanner.nextLine();
if (cuisineType.equalsIgnoreCase("mexican") || cuisineType.equalsIgnoreCase("italian") || cuisineType.equalsIgnoreCase("chinese") || cuisineType.equalsIgnoreCase("indian") || cuisineType.equalsIgnoreCase("fast food") || cuisineType.equalsIgnoreCase("bbq") || cuisineType.equalsIgnoreCase("breakfast") || cuisineType.equalsIgnoreCase("sandwiches")){
validInput = true;
}
else{
System.out.print("Invalid input!\n");
}
}
// Default value
String budget = "low";
validInput = false;
// Loops until user's input is valid (low, medium, or high)
while (!validInput){
System.out.print("How much money are you willing to spend? (low, medium, high): ");
budget = scanner.nextLine();
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("l") || budget.equalsIgnoreCase("m") || budget.equalsIgnoreCase("h")){
validInput = true;
}
else{
System.out.print("Invalid input!\n");
}
}
// Display suggestions based on user preferences
System.out.println("\nBased on your preferences, here are some restaurant options for you:");
switch (cuisineType.toLowerCase()) {
case "mexican":
System.out.println(getMexicanRestaurant(budget));
break;
case "italian":
System.out.println(getItalianRestaurant(budget));
break;
case "fast food":
System.out.println(getFastFoodRestaurant(budget));
break;
case "bbq":
System.out.println(getBBQRestaurant(budget));
break;
case "breakfast":
System.out.println(getBreakfastRestaurant(budget));
break;
case "sandwiches":
System.out.println(getSandwichesRestaurant(budget));
break;
case "chinese":
System.out.println(getChineseRestaurant(budget));
break;
case "indian":
System.out.println(getIndianRestaurant(budget));
break;
default:
System.out.println("Sorry, we couldn't find suitable options based on your preferences.");
}
scanner.close();
}
// Method to suggest Mexican restaurants based on budget
public static String getMexicanRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Taco Bell\n2. Chipotle\n3. El Barrio";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. El Barrio\n2. Moe's Southwest Grill\n3. Los Arcos";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. La Paz\n2. Cocina Superior\n3. Sol Y Luna";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest Italian restaurants based on budget
public static String getItalianRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Olive Garden\n2. Ranelli's\n3. Sanpeggio's";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Carrabba's Italian Grill\n2. Johnny Brusco's New York Style Pizza\n3. Little Italy";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. Gianmarco's Restaurant\n2. Bottega Cafe\n3. North Italia";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest Fast Food restaurants based on budget
public static String getFastFoodRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. McDonald's\n2. Cookout\n3. Wendy's";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Chick-fil-A\n2. Tazikis\n3. Cicken Salad Chic";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. Shake Shack\n2. Mooyah\n3. Five Guys";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest BBQ restaurants based on budget
public static String getBBQRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Dreamland BBQ\n2. Jim 'N Nick's Bar-B-Q\n3. Full Moon BBQ";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Saw's BBQ\n2. Moe's Original Bar B Que\n3. Rib-It-Up";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. Rodney Scott's Whole Hog BBQ\n2. Martin's Bar-B-Que Joint\n3. Archibald's BBQ";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest Breakfast restaurants based on budget
public static String getBreakfastRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Waffle House\n2. IHOP\n3. McDonald's (breakfast menu)";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Cracker Barrel Old Country Store\n2. First Watch\n3. Another Broken Egg Cafe";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. Another Broken Egg Cafe\n2. Big Bad Breakfast\n3. Highland Gourmet Scones";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest Sandwiches restaurants based on budget
public static String getSandwichesRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Subway\n2. Jersey Mike's Subs\n3. Firehouse Subs";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Jimmy John's\n2. Panera Bread\n3. Jason's Deli";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. McAlister's Deli\n2. Which Wich Superior Sandwiches\n3. Potbelly Sandwich Shop";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest Chinese restaurants based on budget
public static String getChineseRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Magic Wok\n2. China Moon\n3. yoe Xpress";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Shiki Sakura\n2. Panda Express\n3. P.F. Chang's";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. Tattu Birmingham\n2. P.F. Chang's\n3. Mr. Chen’s Authentic Chinese Cooking";
} else {
return "No options found for the given budget.";
}
}
// Method to suggest Indian restaurants based on budget
public static String getIndianRestaurant(String budget) {
if (budget.equalsIgnoreCase("low") || budget.equalsIgnoreCase("l")) {
return "1. Sitar Indian Restaurant\n2. Silver Coin Indian Grill\n3. Silver Kati";
} else if (budget.equalsIgnoreCase("medium") || budget.equalsIgnoreCase("m")) {
return "1. Yummefy Indo Fresh Food & Bar\n2. Taj India\n3. Saffron Indian Kitchen";
} else if (budget.equalsIgnoreCase("high") || budget.equalsIgnoreCase("h")) {
return "1. Bay Leaf Modern Indian Cuisine & Bar\n2. Saffron Indian Kitchen\n3. Lasan Indian Restaurant & Cocktail Bar";
} else {
return "No options found for the given budget.";
}
}
}