Questions
- Overload
operator=in yourShapeexercise from Chapter 8, Mastering Abstract Classes, or alternatively, overloadoperator=in your ongoingLifeForm/Person/Studentclasses as follows:
Define operator= in Shape (or LifeForm) and override this method in all of its derived classes. Hint: the derived implementation of operator=() will do more work than its ancestor, yet could call its ancestor’s implementation to perform the base class part of the work.
- Overload
operator<<in yourShapeclass (orLifeFormclass) to print information about eachShape(orLifeForm). The arguments to this function should be anostream &and aShape &(or aLifeForm &). Note thatostreamis from the C++ Standard Library (using namespace std;).
You may either provide one function, ostream &operator<<(ostream &, Shape &);, and from it call a polymorphic Print(), which is defined in Shape and redefined in each derived class. Or, provide...