Module 7. Overloading Operators Exercise Answers

1.
   // -------- member function to overload the == operator
   int ZooAnimal::operator== (int date)
   {
    return (weightDate == date);
   }


2.
   // -------- member function to overload the -- operator
   void ZooAnimal::operator-- ()
   {
    weight -= 1;
   }


3.
   // -------- member function to overload the function call operator
   void ZooAnimal::operator() (int& whichCage)
   {
    whichCage = cageNumber;
   }