Question: Please use java programming. Use classes and do exactly what the question is asking please. Write a Random Walker class that randomly walks in the

Please use java programming. Use classes and do exactly what the question is asking please.
 Please use java programming. Use classes and do exactly what the

Write a Random Walker class that randomly walks in the left or right direction and communicates its movement to an observer that implements the Random WalkObserver interface. The Random Walker has the following properties: Takes one step per second. You can use the Thread.sleep(1000) to make the current thread sleep for 1000 milliseconds or make it an event-driven class using a Timer object. .Has a 50/50 probability of taking a step in the left or right direction. oHas the facility for adding and deleting Random WalkObserver objects. Will communicate its movement to the observers using the methods in the Random WalkerObserver interface. interface Random WalkObserver void moved(Random WalkEvent); The RandomEvent object contains the direction of movement and the reference to the Random Walker object. Write an observer class that implements Random WalkObserver interface and monitors the movement of the Random Walker. The observer should print how many steps it takes for the Random Walker to move 5, 10, 15, 20, and 25 spaces in the left or right direction from its initial starting point. (You can plot the path of the Random Walker if you like)

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!