Question: java programming 2. Write a Random Walker class that randomly walks in the lefi or rit omnWalkobserve communicates its movement to an observer that implements

java programming
2. Write a Random Walker class that randomly walks in the lefi or rit omnWalkobserve communicates its movement to an observer that implements the Random interface direction and WalkObserver The Random Walker has the following properties Takes one step per second. You can use the Thread.sleep(1000) to r thread sleep for 1000 milliseconds or make it an event-driven class using a Has a 50/50 probability of taking a step in the left or right direction Has the facility for adding and deleting Random WalkObserver objects make the curr Timer object. ill 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
To implement this program in Java youll create a RandomWalker class a RandomWalkObserver interface and an observer class implementing this interface B... View full answer
Get step-by-step solutions from verified subject matter experts
