Page 1 of 1

Implement a class Robot that simulates a robot wandering on an infinite plane with m*n tiles. The robot is located at a

Posted: Sat May 14, 2022 7:55 pm
by answerhappygod
Implement A Class Robot That Simulates A Robot Wandering On An Infinite Plane With M N Tiles The Robot Is Located At A 1
Implement A Class Robot That Simulates A Robot Wandering On An Infinite Plane With M N Tiles The Robot Is Located At A 1 (49.63 KiB) Viewed 28 times
JAVA
MAINLY A and B most important
Implement a class Robot that simulates a robot wandering on an infinite plane with m*n tiles. The robot is located at a point with integer coordinates (x,y) and faces north (0), east(1), south(2), or west(3). Supply methods public void turnleft() public void turnRight() public void move() public Point getLocation() public String getDirection() public String toString() The turnleft and turn Right methods change the direction but not the location. The move method moves the robot by one unit in the direction it is facing. The getDirection method returns a string "N", "E", "S", or "W". You can define necessary data members in the class. 0 1 2 3 4 5 6 7 8 w E S 0 1 2 3 4 5 6 7 8 a) (6 points) Write the definition of a class Robot based on the requirements above. b) (2 points) Write a program that tests various operations of the class Robot. c) (2 points) What is the difference between overloading a method name and overriding a method name?