-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriver.java
More file actions
73 lines (47 loc) · 1.39 KB
/
Driver.java
File metadata and controls
73 lines (47 loc) · 1.39 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
package assignment6;
import java.util.Scanner;
/**
* @author Rían Adamian
*/
public class Driver {
public static void main(String[] args) {
OrderingSystem os = new OrderingSystem(Menu.getMenu());
Scanner in = new Scanner(System.in);
int choice = 7;
System.out.println("Welcome to the Food Ordering System!");
whileLoop:
while (choice != 0) {
System.out.println("Choose one of the following options:");
System.out.println("1. New Order\n2. List Items\n3. Add Item to Order\n4. Order a Meal Combo\n5. Finalize Order\n6. Exit");
choice = in.nextInt();
switch (choice) {
case 1:
os.newOrder();
break;
case 2:
os.listAll();
break;
case 3:
System.out.println("Enter what you would like to order: ");
String itemName = in.nextLine();
os.addToOrder(itemName);
break;
case 4:
System.out.println("Enter the appetizer you would like to order: ");
String appetizer = in.nextLine();
System.out.println("Enter the main course you would like to order: ");
String main = in.nextLine();
System.out.println("Enter the dessert you would like to order: ");
String dessert = in.nextLine();
os.createFullMeal(appetizer, main, dessert);
break;
case 5:
os.finalizeOrder();
break;
case 6:
break whileLoop;
}
}
in.close();
}
}