Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started