A Bug's Life

Create a new project named ABugsLife and add new classes named Location and Bug that are copied and pasted from the versions of the Location and Bug classes that are found in the Unit 2 Demo Programs area of our website. However, you must edit the Bug class by adding the following methods:

  • turnRight - an exact copy of the existing turn method
  • turnLeft - turns the bug 45 degrees to the left by updating his direction property
  • moveTwo - a modified version of move that moves the bug two units in the current direction rather than one unit by updating his location property appropriately
  • an interesting method named something like moveLikeJagger or moveLikeAG6 or moveLikeAKnightInChess or doTheDougieDance - this method should move the bug in an interesting way by updating his direction and/or location properties

Also, write a client class named ABugsLife. This class should be modelled on the BugTracingDemo1 and self-created Bug Tracing #1 client classes so that it calls and makes use of the turnRight, turnLeft, & moveTwo methods above. This class must instantiate a bug named flik (or whatever name you choose to use). You must printout the "AFTER" state of the bug as you did in self-created Bug Tracing worksheet.

Your program must follow the class Coding Standards. Save all of the files associated with this assignment in the appropriate network folder.

Preconditions:

    • None

You must hand in the following on separate pages stapled in this specified order:

    1. The source code for your ABugsLife client class.
    2. The source code for the modified Bug class.
    3. The printscreen of your console window output.