Question: Write a class called Student which subclasses Person and adds their year in college ( freshman , etc. ) . Write a class called Employee
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 tostring method.
For example, the output from a list of entities might be:
Person named Susan has phone number and can be reached at susan@quirkymail.com
Person named Jerry has phone number and can be reached at jerjer@nat.edu is in the sophomore year
Person named Larry has phone number and can be reached at larry@threestooges.org earns annually
Person named Linda has phone number and can be reached at lindalou@whoknew.edu earns annually is aan adjunct professor
Person named Jane has phone number and can be reached at jane@whizkid.com earns annually handles registration
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
