INTRODUCTION TO
PROGRAMMING IN
C++
Supplementary Assignment:
More Enhancements to the Aquarium Program
Alyce Brady
Kalamazoo College
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:
- 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).
Research the full AquaFish
Interface to determine how to tell whether a fish is at the surface,
at the bottom, or somewhere in between.
- Update the documentation and comments in your program to reflect
these changes.
- Save and print your work.