-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRestaurantApp.java
More file actions
161 lines (151 loc) · 4.18 KB
/
Copy pathRestaurantApp.java
File metadata and controls
161 lines (151 loc) · 4.18 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
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
import java.util.Scanner;
/**
* Represents a restaurant application for users to communicate with respective managers.
*/
public class RestaurantApp {
/**
* Reservation manager of the restaurant.
*/
public static ReservationManager globalReservationManager;
/**
* Order manager of the restaurant.
*/
public static OrderManager globalOrderManager;
/**
* Table Manager of the restaurant.
*/
public static TableManager globalTableManager;
/**
* Staff Manager of the restaurant.
*/
public static StaffManager globalStaffManager;
/**
* Menu Manager of the restaurant.
*/
public static MenuManager globalMenuManager;
/**
* Invoice manager of the restaurant.
*/
public static InvoiceManager globalInvoiceManager;
/**
* Main function of the application.
* @param args Program to run.
*/
public static void main(String[] args) {
globalMenuManager = new MenuManager();
globalStaffManager = new StaffManager();
globalReservationManager = new ReservationManager();
globalTableManager = new TableManager();
globalInvoiceManager = new InvoiceManager();
globalOrderManager = new OrderManager();
System.out.println("Hello welcome to RRPS:");
int choice = 1;
Scanner sc = new Scanner(System.in);
do{
System.out.println("Main Menu: ");
System.out.println("Please choose an option:");
System.out.println(
"\n{Main menu} .__________. \n" +
"Which do you wish to access?\n" +
"1. Menu Manager\n" +
"2. Table Manager\n" +
"3. Order Manager\n" +
"4. Reservation Manager\n" +
"5. Sales Report\n" +
"6. Staff Manager\n\n" +
"Enter 0 to cancel");
choice = sc.nextInt();
System.out.println();
switch (choice){
case 1://menumanager
System.out.println("What do you want to do? :-) \n" +
"1. Print Menu\n" +
"2. Add Item\n" +
"3. Remove Item from Menu\n" +
"4. Update Item\n\n" +
"ENTER 0 TO QUIT\n");
int menuChoice = 0;
menuChoice = sc.nextInt();
sc.nextLine();
switch (menuChoice) {
case 1:
globalMenuManager.printMenu();
break;
case 2:
globalMenuManager.addItem();
break;
case 3:
globalMenuManager.removeItem();
break;
case 4:
globalMenuManager.updateItem();
break;
}
break;
case 2:
int tableChoice = 0;
do {
System.out.println("What do you want to do? :-) \n" +
"1. Print Available Tables\n" +
"2. Print Occupied Tables\n" +
"3. Print Reserved Tables\n" +
"ENTER 0 TO QUIT\n");
tableChoice = sc.nextInt();
switch (tableChoice) {
case 1:
globalTableManager.printTables(globalTableManager.getAvailableTables());
break;
case 2:
globalTableManager.printTables(globalTableManager.getOccupiedTables());
break;
case 3:
globalTableManager.printTables(globalTableManager.getReservedTables());
break;
}
} while (tableChoice!=0);
break;
case 3:
int orderChoice = 0;
do {
System.out.println("What do you want to do? :-) \n" +
"1. Create Order\n" +
"2. Cancel Order\n" +
"3. Change Order\n" +
"4. Print Order List\n"+
"5. Print Order Invoice\n\n" +
"ENTER 0 TO QUIT\n");
orderChoice = sc.nextInt();
sc.nextLine();
switch (orderChoice) {
case 1:
globalOrderManager.createOrder();
break;
case 2:
globalOrderManager.cancelOrder();
break;
case 3:
globalOrderManager.changeOrder();
break;
case 4:
globalOrderManager.printOrderList();
break;
case 5:
globalInvoiceManager.chooseInvoice();
break;
}
} while (orderChoice!=0);
break;
case 4:
globalReservationManager.printInterface();
break;
case 5:
SalesReport salesReport = new SalesReport();
salesReport.printSalesReport();
break;
case 6:
globalStaffManager.printInterface();
break;
}
} while (choice != 0);
}
}