Wyo Java Ch9Proj2

Obtain a copy of the Ch9Proj2 folder from the Handout folder on the network. Study the code in each of the classes Direction, Location, Locatable, RandNumGenerator, & Fish. The majority of this code comes from the College Board Marine Biology Case Study. You don't really have to understand the RandNumGenerator class since it's considered to be a black box class. See Mr. Minich though if you have questions about any of this code.

Implement the methods nextLocation and determineNewDirection found in the Fish class as specified by their postconditions. Notice how I placed "STUB CODE" where necessary to ensure that the class compiles for now. In this exercise (and in the real Marine Biology Case Study) a fish's direction is determined by how he moves. For example, if his original location is (1, 1) and moves to (2, 1), his new direction is South.

Be sure that you understand the orientation of locations in this assignment. Since we will later be studying two-dimensional arrays with "RC Cola" organization, in this assignment a fish

Execute the provided client program named Ch9Proj2 that instantiates a Fish object and uses a loop to call his act method 20 times and make sure that the fish's moves are logically correct according to the specs above.

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

Preconditions:

    • Boundaries do not have to be checked. A fish can move to a location of -1, -5 where myCol is -1 and myRow is -5

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

    1. The source code for the Fish class with circles drawn around the nextLocation and determineNewDirection methods.
    2. The printscreen of your console window output. Be sure to print black text on white background (even though my example does not.)