Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago