Question: 5. Consider a rectangular grid of size 100x100. Each square in the grid has a unique row and column number (x, y). The square (0,0)

 5. Consider a rectangular grid of size 100x100. Each square in

5. Consider a rectangular grid of size 100x100. Each square in the grid has a unique row and column number (x, y). The square (0,0) is at the middle; x values increase to the right and decrease to the left; y values increase going down and decrease going up. We want to create a Robot class. Each Robot object represents one robot. Each robot has a location (x, y), and a direction in which it is facing (up, right, down, or left). A robot can move one square forward in the direction it is facing. It can also turn 90 degrees to the right. In addition, we shall be able to know a robot's current x and y position and direction. Write the Robot class that includes the data and behavior needed as described

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!