Question: Question 2: In the following Inheritance problem #include #include using namespace std; class Animall private Int height: Intage: Int weight: public Animal): Animalfint h, Inta.

 Question 2: In the following Inheritance problem #include #include using namespace

Question 2: In the following Inheritance problem #include #include using namespace std; class Animall private Int height: Intage: Int weight: public Animal): Animalfint h, Inta. Int w): vold print(const: : class Dog public Animall private : string dogType: public: Dogo: Dog(int hint a. Int w, string dt): vold print[)const: 1: class German Shephard: public Dog private: string name: public: German Shephard): GermanShephardint h, inta, int w, string dt, string n): vold print(const: int maint Animala: Dog d; Dog d1[45, 7, 25. "wild"): d1.print(): German Shephard gs: gs.print(): German Shephard ms(61,5, 30, "pet", "Coco"): ms.print(): return 0 } 1. Complete the implementation of each classes. 2. What is the sequence of call of default constructors and destructors when objects gs and ms are called? 3. If you make both inheritances private or protected do it affect the output in the main function

Step by Step Solution

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 Databases Questions!