Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 3 Not yet answered Marked out of 10.00 Using the state pattern, you have to implement a robot that can; walk, run, and cook
Question 3 Not yet answered Marked out of 10.00 Using the state pattern, you have to implement a robot that can; walk, run, and cook based on an action provided by the user. In your design take the following into consideration: 1. The robot is considered ready after the user switched it on. 2. The robot can start cooking based on action from the user. 3. The robot state can go from walk to run without out user action 4. The robot goes off after finishing the task (either walk, run or cook) or the user explicitly switch it off. P Flag question Q1) (2 points) Draw the class diagram that shows all classes and the role of each class? Q2) (2) Write code of the walk state? 23) (6 points) Write the implementation of the Robot 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started