Question: 1 . The flow starts from Restaurant 2 . When a new customer comes to restaurant, customer object is created and his name is set.
The flow starts from Restaurant
When a new customer comes to restaurant, customer object is created and his name is set.
A new waiter is called to customer, waiter object is created
The waiter comes to customer to take order, waiter.takeOrdercustomer method is called. He
will show menu, menu method is called.
A new order is created
Customer.orderingItems is called and the return type order is passed into order
The waiter collects order from customer and he will place the order to the chef,
placeOrderTochef method.
Here there will be a VegChef and NonVegChef. Both objects are created here.
If order is veg it is sent to veg section and vegSectionOrder method is called.
If order is Non veg it is sent to non veg section and nonVegSectionOrder method is called.
From any of them prepareOrderorder method is called which can be called from both classes.
prepareOrderorder internally calls callWaiterverRnonVeg method so that after preparing
order chef delivers the order to waiter
After receiving order customer will start eating customer.eat
Bill object is created
Bill is generated according to customer order, by generateBillCustomer method.
Chef
void prepareOrderOrder order, String vegRnonVeg
void callWaiterString vegRnonVeg
VegChef
public void vegSectionOrder order
NonVegChef
public void nonVegSectionOrder order
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
