a class of teacher that contains the attribute teacher name,age and address. it also contain member function to input and display. write another class of writer that contains the attribute name,address and no of book witten byhim.it also contain member function to input and show.
#include <iostream.h>
#include <conio.h>
class Teacher
{ private:
char Name[30];
public:
char Address[50];
public:
void input()
{cout<<"Enter your name"<<end1;
cin>>name;
cout<<"Enter your age"<<end1;
cin>>age;
cout<<"Enter your Address"<<end1;
cin>>Address;
}
void dislay()
{cout<<end1<<"your Name is"<<Name<<end1;
cout<<end1<<"your age is"<<age<<end1;
cout<<end1<<"your Address is"<<Address<<end1;
}
}
Comments
Leave a comment