Question 1 (10 points) Implement a class Robot that simulates a robot wandering on an infinite plane with m*n tiles. The

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Question 1 (10 points) Implement a class Robot that simulates a robot wandering on an infinite plane with m*n tiles. The

Post by answerhappygod »

Question 1 10 Points Implement A Class Robot That Simulates A Robot Wandering On An Infinite Plane With M N Tiles The 1
Question 1 10 Points Implement A Class Robot That Simulates A Robot Wandering On An Infinite Plane With M N Tiles The 1 (53.66 KiB) Viewed 53 times
Question 1 (10 points) 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 turn Right() 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. 00 W E m N S o 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?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply