Question: Write a program which defines a Person class. The Person class a name, a phone number, and an email address. Add a virtual toString() method

Write a program which defines a Person class. The Person class a name, a phone number, and an email address. Add a virtual toString() method that outputs a human readable description of the instance variables in the class. Write a class called Student which subclasses Person and adds their year in college (freshman, etc.). Write a class called Employee which subclasses Person and adds a salary. Write another class called Faculty which subclasses Employee and adds a title. Write another class called Staff that subclasses Employee and adds a role. Override the toString() method in each subclass to output the additional instance variable information. Add the override keyword to each overridden method. Create an array of pointers to Person. Add at least one instance each of Person, Student, Employee, Faculty, and Staff. Iterate over all Person instances in the vector and call the to_string() method. For example, the output from a list of entities might be: Person named Susan has phone number 800-555-1212 and can be reached at susan@quirkymail.com Person named Jerry has phone number 123-456-7890 and can be reached at jerjer@nat.edu is in the sophomore year Person named Larry has phone number 333-444-5555 and can be reached at larry@threestooges.org earns 123456.000000 annually Person named Linda has phone number 987-654-3210 and can be reached at lindalou@whoknew.edu earns 150000.000000 annually is a/an adjunct professor Person named Jane has phone number 567-123-6565 and can be reached at jane@whizkid.com earns 100000.000000 annually handles registration

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!