Question: Overload operator < < in your Shape class (or LifeForm class) to print information about each shape (or LifeForm). The arguments to this function should

Overload operator<< in your Shape class (or LifeForm class) to print information about each shape (or LifeForm). The arguments to this function should be an ostream \& and a shape \& (or a LifeForm \&). Note that ostream is 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 multiple operator<< methods to implement this functionality (one for each derived class). If using the Lifeform hierarchy, substitute LifeForm for Shape, in the aforementioned operator<< function signature.

Step by Step Solution

3.33 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related A Practical In Depth Guide C++ Questions!