Advertisement
FaisalJamil

Homework 2.7

Feb 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. //BackupBot class
  2. import becker.robots.*;
  3. public class BackupBot extends RobotSE {
  4.     public BackupBot(City city, int aStreet, int anAvenue, Direction aDirection) {
  5.         super(city, aStreet, anAvenue, aDirection);
  6.     }
  7.     public void Backup() {
  8.         this.setSpeed(5);
  9.         this.turnAround();
  10.         this.move();
  11.         this.turnAround();
  12.     }
  13. }
  14.  
  15. //Main class
  16. import becker.robots.*;
  17. public class Main {
  18.  
  19.     public static void main(String[] args) {
  20.         City Mississauga = new City();
  21.         BackupBot Robot = new BackupBot(Mississauga,1,1,Direction.SOUTH);
  22.         Robot.Backup();
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement