// person-stu-teach.h // Person (base) class // Student and Teacher (derived) classes // delcarations #include // prevent multiple inclusions of header file #ifndef person_stu_teach_h #define person_stu_teach_h class Person { public: Person(char *n = ""); void setName(char *n); void print(); protected: char name[25]; }; // class definition of Teacher // Teacher is derived from Person // this class extends the Person class class Teacher: public Person { public: Teacher(char * = ""); int addCourse(); // add a course // other members inherited from Person private: int numcourses; // number of courses teaching static int MaxCourses; // max numer of courses // any Teacher could teach }; // declaration of derived Student class // this class will specialize some of the // features of the base class (see print function) class Student: public Person { public: Student(char * = ""); void setYear(int); void print(); private: int year; }; #endif