CS代写之JAVA Scavenger Hunt Goal
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 Solufion
Download the scenario for this assignment, which contains the class: program1.zip.
In the program1 scenario, create your own subclass of
. Place your solution in
the myProgram() method of the class.
In writing your solution, if the only method you write is , 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 ) in your island subclass. You are also free to create your own
subclass of (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.
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 method of the ScavengerHunt class does not execute: Rightclick on
your class and create a new ScavengerHunt object before pressing the Run button.
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.
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.
(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
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).
Submifing Your Solufion
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.