Question: Inheritance Question 7 (a) Multiple inheritance is a case where one class is derived from two or more classes. For example, the following declaration shows

 Inheritance Question 7 (a) Multiple inheritance is a case where one

class is derived from two or more classes. For example, the following

Inheritance Question 7 (a) Multiple inheritance is a case where one class is derived from two or more classes. For example, the following declaration shows that square is derived from both shape and polygon. class square public shape, polygon What are the advantages of multiple inheritance? What are the negative points and potential problems of multiple inheritance? 13 marks] (b) Given the G++ declaration: class A public:int x protected: int y; Which of the following would be rejected by the compiler? Explain you an- swer briefly 1) class B: public A void fo (x y; ) 2) class B void f() { A a; a.x.. a,y; } 3) class B: public A class C: public B void f() { x-y; } 4) Both variants 2 and 3. 5) None of the above [3 marks]

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!