-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTable.java
37 lines (32 loc) · 1.04 KB
/
Table.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
class Table {
private int tableNo;
private Menu menuOrdered;
private int orderTime;
private Employee orderProgress;
public Table(int tableNo) {
this.tableNo = tableNo;
}
public void viewProgress() {
if (orderProgress != null) {
System.out.println("Order in progress by: " + orderProgress.getName());
} else {
System.out.println("No order in progress.");
}
}
public String sendFeedback() {
// implementation for sending feedback
return "Thank you for your feedback!";
}
public String orderMenu(Menu menu) {
this.menuOrdered = menu;
this.orderTime = getCurrentTime(); // assume getCurrentTime() returns the current time
this.orderProgress = null;
return "Menu ordered successfully!";
}
public String cancelOrder() {
this.menuOrdered = null;
this.orderTime = 0;
this.orderProgress = null;
return "Order canceled successfully!";
}
}