Question: 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
- 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. Make the Author class a friend class of Teacher class. In main, exercise and show how Author can access private data of Teacher class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
