Question: Question 7: (CLO2- 8 marks] a) should destructors in the base class Person be declared virtual? Explain why or why not. [2 marks] b) Can
![Question 7: (CLO2- 8 marks] a) should destructors in the base](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f38bacedc46_03666f38bac89dd8.jpg)
Question 7: (CLO2- 8 marks] a) should destructors in the base class Person be declared virtual? Explain why or why not. [2 marks] b) Can we make a constructor virtual? Why or why not? (Explain with reference to VPTR). [1 mark] c) Can we make Person class as abstract class? If yes, how? If no, why? [1 mark] d) What happens if we do not make a constructor of an abstract class. Explain. [1 mark] e) Is is possible to make 'promote' function as virtual? Can this class be made abstract? Justify your answer. [1 mark] f) should we define a destructor of an abstract class? Justify your answer with proper reasoning. [1 mark] g) Why was there a need to define virtual functions? Explain an issue/trouble faced in inheritance that is only resolved by making functions virtual? [1 mark]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
