3.A program to get the information of a derived class data members via name, roll number, sex, height and weight from the keyboard; again to read data for another derived class such as name, roll number, sex, course, semester and rank and display the contents of the newly created class on the screen.
This program demonstrates a single inheritance concept which consists of a single base class and two derived classes. The data members and member functions of the base class are independently accessed by these two derived classes. The OMT of a class notation for single inheritance is given in Fig. 12.5.
Fig. 12.5 OMT of a Class Notation for Single Inheritance
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here