Write a class Teacher that contains the attribute teacher name, age and address. It also contains member function to input and display its attributes. Write another class Author that contains the attributes author name, address and number of books written by him. It also contains member functions to input and display its attributes. Write a third class Scholar that inherits both Teacher and Author classes. Test these classes from main() by creating of derived classes and testing functions in a way that clear concept of multiple Inheritance.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a class Teacher that contains the attribute teacher name, age and address. It also contains member function to input and display its attributes. Write another class Author that contains the attributes author name, address and number of books written by him. It also contains member functions to input and display its attributes. Write a third class Scholar that inherits both Teacher and Author classes. Test these classes from main() by creating of derived classes and testing functions in a way that clear concept of multiple Inheritance.
Step by step
Solved in 3 steps with 3 images