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 Writer that contains the attributes writer 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 Writer classes. Write a main program which will create the object of each class and input data using input function and show data using display function of their relevant class.
Comments
Leave a comment