Question: Consider the class hierarchy below. class Bird ! private : string name; int speed; public: Bird (string, int); virtual void sing(); virtual void fly(); string

Consider the class hierarchy below. class Bird ! private : string name; int speed; public: Bird (string, int); virtual void sing(); virtual void fly(); string getName() const; }; class Birdof Prey : public Bird { protected: bool hungry: public: BirdofPrey (string, int, bool = true); virtual void kill Prey(); }; class Eagle : public Birdof Prey { public: Eagle (string, int, bool = false); void killPrey (); void sing(); }; class Hen : protected Bird { public: Hen (string); virtual void sing(); void layEggs(); }; Indicate if the code snippet bellow is valid (True) or invalid (False): Bird* eagle = new Eagle("Fish Eagle", 75); eagle->killPrey()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
