|
Wyo Java Ch7Proj3 |
|
Extend Ch7Proj2 with the additional specifications. The fish must stay in a bounded area that has a left edge of x = -5, a right edge of x = 5, a top edge of y = -5, and a bottom edge of y = 5. For example, a fish could find itself pointed east in position (5, 5) which would be the bottom-right corner. But a fish cannot move to the position (6, 5). Rather, the fish must stay in place and use a pseudorandom integer to turn right, turn left, or stay pointed in the same direction. You must instantiate your first fish in position (5, -5) with a direction of east and your second fish in position (-5, -5) with a direction of west. Display your name and the project name on the first line of output (even though my example below does not.) Your program must follow the class Coding Standards. Save all of the files associated with this assignment to a folder named Ch7Proj3 in the appropriate network folder. Here is a sample output screen.
AP students must submit two versions of this project. One version must display the text output above. Another version must display the output in the graphical format below where each fish is represented by his ID number and his direction is pointed by >, <, ^, v which represent east, west, north, and south, respectively. These two versions must be saved in two separate folders. Name the graphical version Ch7Proj3Graphical.
Preconditions:
You must hand in the following on separate pages stapled in this specified order:
|