// e62.cpp // Example of basic inheritance #include #include using namespace std; class Teacher{ // Base class protected: // public for derived class string name; int age,numOfStudents; public: void setTeacher (const string &, int , int); void print() const; }; void Teacher::setTeacher (const string &new_name,int a,int nos) { name=new_name; age=a; numOfStudents=nos; } void Teacher::print() const // Print method of Teacher class { cout <<"Name: "<< name<<" Age: "<< age<< endl; cout << "Number of Students: " <