Tasks for our lab class on objects:
- Adjust int main to add cows betsy and darren, one with weight 200 and
location 10, the other with weight 350 and location 2.5, print out the
location for each animal using the member variable (e.g.,
betsy.location) and the member function (e.g., betsy.getLocation())
- Make a pass-by-reference alternate to getWeight -- i.e., void
getWeight(float& weightVariable);
- See what happens to cout << betsy.location when member variables
(weight and location) are made private.
- Make private function moo() that print "Moooo" to the screen when
called. Call moo() when cow has walked a long distance or has been
eating for a long time (you define "long distance" and "long time")
- Adjust walk(...) to have cow lose weight as s/he walks
- adjust set(...) to refuse a negative weight
- advanced: add an array that keeps track of each location the cow has
walked to; add general array search function to program; if cow gets
to a location where s/he has been before, moo twice