Suppose you have a class cbird as follows that you want to


Suppose you have a class CBird, as follows, that you want to use as a base class for deriving a hierarchy of bird classes:

class CBird

{

protected:

int wingSpan;

int eggSize;

int airSpeed;

int altitude;

public:

virtual void fly() { altitude = 100; }

};

Is it reasonable to create a CHawk by deriving from CBird?

How about a COstrich? Justify your answers.

Derive an avian hierarchy that can cope with both of these birds.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Suppose you have a class cbird as follows that you want to
Reference No:- TGS01123874

Now Priced at $35 (50% Discount)

Recommended (92%)

Rated (4.4/5)