-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCafeteriaManagementSystem.java
More file actions
38 lines (31 loc) · 1.32 KB
/
CafeteriaManagementSystem.java
File metadata and controls
38 lines (31 loc) · 1.32 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
package cafeteria;
public class CafeteriaManagementSystem {
public static void main(String[] args) {
try {
Menu menu = new Menu("Lunch", "2025-01-09");
menu.showMenu();
Report report = new Report("Abebe");
// Customer places an order
Customer customer = new Customer("Kebede", "CUST001", "123-456-7890");
String[] itemsOrdered = {"Tibs", "Sambusa"};
Order order = customer.placeOrder(menu, itemsOrdered);
order.printOrderDetails();
// Employee manages the order
Employee employee = new Employee("John", "EMP001", "098-765-4321", "Manager", "Morning");
employee.manageOrder(order);
// Payment using cash
Payment payment = new CashPayment(100.00); // Cash drawer starts with ETB 100
double amountPaid = 120.00; // Customer pays ETB 120
boolean paymentSuccess = payment.processPayment(order, amountPaid);
if (paymentSuccess) {
report.addSales(order.getTotalAmount());
}
// Employee serves food
employee.serveFood();
// Generate report
report.generateReport();
} catch (Exception e) {
System.out.println("Error: " + e.getMessage());
}
}
}