More Enhancements to the Aquarium Program
For this assignment you will enhance the Aquarium program.
- Add two new public member functions, Ascend and
Descend to the AquaFish class. Each function should cause the
fish to move up or down by one y-coordinate value. (Remember that
ascending means going to a lower y-coordinate value and descending means
going to a higher one.)
- Modify your main function to allow fish to ascend or
descend before moving forward, according to the following formula:
Research the full AquaFish
Interface to determine how to tell whether a fish is at the surface,
at the bottom, or somewhere in between.
- A fish at the surface has a 5/6 chance of descending (and a 1/6
chance of staying at the surface).
- A fish at the bottom has a 1/6 chance of ascending (and a 5/6
chance of staying at the bottom).
- A fish that is neither at the surface nor at the bottom has a 1/6
chance of ascending and a 1/6 chance of descending (and a 2/3
chance of staying at the same depth).
- Update the documentation and comments in your program to reflect
- Save and print your work.