Question: 1 . Describe the feature called Inheritance. Explain the benefits of using this feature. 2 . Where are items accessible if they are protected? 3

1. Describe the feature called Inheritance. Explain the benefits of using this feature.
2. Where are items accessible if they are protected?
3. Write a prototype for a function named display as it would appear in a base class if we wanted it to enable polymorphism as well as make the class an abstract base class.
4. Suppose Dog is a derived class, derived from Animal. Given: Animal a; Dog b;
Which of the following results in a syntax error? Explain why.
a= b;
b= a;
5. Write a class named Person (header and implementation files, no comments). For data just store a Person's name. Write one function, a display function. Feel free to call other functions if you like, but you do not have to write the ones I don't ask for.Next, derive a class named Student from Person. For data use only one new piece of information, the student's GPA. Over-ride the display function so that all information for a Student is displayed.

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!