2018/7/10 Program 1
Program 1
Due Monday by 8am Points 100 Available Jul 6 at 8pm Jul 19 at 8am 13 days
Program 1: Scavenger Hunt
Goal
In your first program assignment, your task is to navigate a jeroo located on "Long Island":
Your jeroo should start at location (2, 2), facing east, with no flowers
Write a program that creates your jeroo in the correct starting position, and then has the jeroo hop and pick all seven
flowers, ending up at the location of the flower in the center of the island.
Structuring Your Soluon
Download the scenario for this assignment, which contains the LongIsland class: program1.zip.
In the program1 scenario, create your own subclass of LongIsland called ScavengerHunt. Place your solution in
the myProgram() method of the ScavengerHuntclass.
In writing your solution, if the only method you write is myProgram(), your code will likely be long and bulky.
Instead, think of how you can create your own methods to represent recurring, identifiable tasks. You are free
to write your own methods (in addition to myProgram()) in your island subclass. You are also free to create your own
subclass of Jeroo (with a name of your choice), and add your own methods to it. Remember these guidelines:
Break your problem into smaller, more manageable pieces.
Use new methods to represent meaningful pieces of your solution.
2018/7/10 Program 1
Give methods meaningful names that reflect what they do.
Place new methods in the class that is responsible for carrying out the corresponding action.
You will be graded in part on the design and readability of your solution, so consider these factors when devising and
naming your methods.
Tip: If it appears that the myProgram() method of the ScavengerHunt class does not execute: Rightclick on
your ScavengerHunt class and create a new ScavengerHuntobject before pressing the Run button.
Grading Criteria
Please read the Program Grading Rubric to learn how TAs will grade your programming assignment submissions.
Note that for this first program assignment only, you are not expected to write your own software tests, so the "Test
Case Design" portion of the grading rubric will not be applied on Program 1.
For Reference
Basic jeroo methods are covered in Chapter 3 of the course ebooklet. Information about breaking tasks down into
pieces, together with examples, appear in Chapter 4 and Chapter 5.
A complete list of all the methods supported by the Jeroo class is available in the online documentation for Jeroo
(http://sofia.cs.vt.edu/api/reference/sofia/micro/jeroo/Jeroo.html) (all of the library classes we use have this
documentationuse the "Help>Greenfoot4Sofia class documentation" link in Greenfoot4Sofia to access them all).
If you have programmed before: Although it is not necessary for this assignment, if you have programmed before
and wish to use loops or if statements in your solution, feel free to do so. The full list of methods supported by
the Jeroo class (http://sofia.cs.vt.edu/api/reference/sofia/micro/jeroo/Jeroo.html) includes a number of "sensor"style
methods so that jeroos can react to their environment, and you may find these useful in constructing a more advanced
solution if you wish (this is not required).
Subming Your Soluon
All program assignments are submitted to WebCAT. Use the Controls>Submit... menu command in Greenfoot4Sofia
to submit your work, just as you would for a lab assignment.