Java代写,java作业代写:100%原创代码
当前位置:以往案例 > >CS案例之JAVA Scavenger Hunt Goal
2019-01-27



Program 1: Scavenger Hunt Goal
In your first program project, your task is to navigate a jeroo located on "Long Island":

image.png

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 project, which contains the class: program1.zip.


In the program1 scenario, create your own subclass of

called

. 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: Right­click on

your class and create a new ScavengerHunt object before pressing the Run button.


Grading Criteria
Please read the Program Grading Rubric to learn how TAs will grade your programming project submissions. Note that for this first program project 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 e­booklet. Information about breaking tasks down into pieces, together with ples, appear in Chapter 4 and Chapter 5.

A complete list of all the methods supported by the class is available in the on­line documentation for

(http://sofia.cs.vt.edu/api/reference/sofia/micro/jeroo/Jeroo.html) (all of the library classes we use have this documentation­­use the "Help­>Greenfoot4Sofia class documentation" link in Greenfoot4Sofia to access them all).

If you have programmed before: Although it is not necessary for this project, 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 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).

Submifing Your Solufion
All program projects are submitted to Web­CAT. Use the Controls­>Submit… menu command in Greenfoot4Sofia to submit your work, just as you would for a lab project.


在线提交订单