Question: please I really need help Question 1- Class Robot & Driver to test it Part a) Class Robot A robot has a name and moves

please I really need help Question 1- Class Robot & Driver totest it Part a) Class Robot A robot has a name andmoves in a 2-dimensional plane (square grid) in a specified direction. Itstarts at location (0,0) facing East and moves a randomly generated numberof steps each turn until it reaches the top right corner ofthe grid, whose coordinates will be N x N, where N isthe size of the square grid. The (x,y) coordinates are to bemodified as follows (see figure 1): If robot is facing E, itplease I really need help

Question 1- Class Robot & Driver to test it Part a) Class Robot A robot has a name and moves in a 2-dimensional plane (square grid) in a specified direction. It starts at location (0,0) facing East and moves a randomly generated number of steps each turn until it reaches the top right corner of the grid, whose coordinates will be N x N, where N is the size of the square grid. The (x,y) coordinates are to be modified as follows (see figure 1): If robot is facing E, it will move right, so the x coordinate is increased. f the robot is facing W, it will move left, so the x coordinate is decreased If the robot is facing N, it will move up, so the y coordinate is increased. f the robot is facing S, it wi move down, so the y coordinate is decreased 5 y-axis (0, 4) The robot cannot walk off the grid. So when it reaches the edge of the grid during any of its turns it needs to change directions and complete the remaining number of steps in the new direction X-axis Figure 1- Grid robot must move in ifa 5x5 grid Implement the class Robot based on the following specification. The class has four instance variables: o name that holds the name of the robot (which can be more than one word long) x and y which are the integer coordinates of the robot's location (between 0 and N, where n is the size of the grid)

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!