October 5, 1995
If you have any new members in your group today, introduce yourselves. One person should be designated the scribe (someone who wasn't the scribe last time). This assignment should be written down on one sheet of paper. Print the number of your group and the name of each group member participating at the top of the sheet.
You are to determine how to modify the class so that the frog walks in two-dimensions, but is constrained to travel along grid points, i.e., only in directions North, South, East, and West. As a first step, you'll need to change the private data member myPosition to two data members: one for north-south (y) position and one for east-west (x) position. Name these two integer data members appropriately.
Then decide how the function TakeStep() will change so that the frog jumps (with equal probability) in one of the compass-point directions (hint: use a four sided die).
You should look carefully at other member functions and decide which ones will need to be modified to reflect the changes in how the frog walks. In particular, you'll need to change the member funtion GetPosition and how it is used. It currently returns one int representing the frog's final position. You'll need to change this so that two values are returned: both an x and y location. Decide how to do this and how the code in main must be altered to reflect the change.
Finally, determine what private data members and what member functions can be added to determine the furthest point from the origin that the frog walks during his exciting sojourn.