// Simple driver for // Student and Teacher class #include #include "person-stu-teach.h" main() { Person p1("Jack Person"); Teacher t1("Jane Doe"); // constructor for Student s1("Fred Smith"); // Person is Student s2("Amanda Franks"); // invoked cout << "The person is:"; p1.print(); // this Person object has access to the Person // member functions and data only // one could not access a year or numcourses for him cout << "The class has the following teacher: "; t1.print(); // print function for Person s1.print(); // print function for Student s2.print(); // calls Person print function // notice Student and Teacher has access to their // member functions as data as well as the base class's }