Question: 1 . The flow starts from Restaurant 2 . When a new customer comes to restaurant, customer object is created and his name is set.

1. The flow starts from Restaurant
2. When a new customer comes to restaurant, customer object is created and his name is set.
3. A new waiter is called to customer, waiter object is created
4. The waiter comes to customer to take order, waiter.takeOrder(customer) method is called. He
will show menu, menu() method is called.
5. A new order is created
6. Customer.orderingItems() is called and the return type order is passed into order
7. The waiter collects order from customer and he will place the order to the chef,
placeOrderTochef() method.
8. Here there will be a VegChef and NonVegChef. Both objects are created here.
9. If order is veg it is sent to veg section and vegSection(Order) method is called.
10. If order is Non veg it is sent to non veg section and nonVegSection(Order) method is called.
11. From any of them prepareOrder(order) method is called which can be called from both classes.
12. prepareOrder(order) internally calls callWaiter(verRnonVeg) method so that after preparing
order chef delivers the order to waiter
13. After receiving order customer will start eating , customer.eat().
14. Bill object is created
15. Bill is generated according to customer order, by generateBill(Customer) method.
Chef
void prepareOrder(Order order, String vegRnonVeg)
void callWaiter(String vegRnonVeg)
VegChef
public void vegSection(Order order)
NonVegChef
public void nonVegSection(Order order)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!