Question: Using the state pattern, you have to implement an application that help track the item ordered from online shop. The client orders an item from

 Using the state pattern, you have to implement an application that

Using the state pattern, you have to implement an application that help track the item ordered from online shop. The client orders an item from online shop, then item can go to post office, then it will be delivered to the user home. Or the item after being ordered it goes to the post office, then the user will pick it up from the post office. In both cases; either take the item from the post office or has it delivered to the client's home represents the end of the process. Q1) (2 points) Draw the state diagram that shows all possible states and transitions? Q2) (2) Write code of the Ordered state? Q3) (6 points) Write the implementation of the ShopOrder class; most important things are the states declaration, the constructor, a function to return robot state

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 Databases Questions!