Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c + + Person Program Create the following classes: Person: Contains private data for first name, last name, street address, zip code, and phone number.

c++ Person Program
Create the following classes:
Person:
Contains private data for first name, last name, street address, zip code, and phone number.
Create accessor/mutator functions for each private data item.
Include a virtual display function that will display all of the persons information on a single line.
Employee:
Employee is a child of Person. An employee also includes a Social Security number, department name.
Create accessor/mutator functions for the additional private data items.
Include a virtual display function that will display ALL of the persons information on a single line.
Customer:
Customer is a child of Person. A customer also includes a discount percentage and an email address.
Create accessor/mutator functions for the additional private data items.
Include a virtual display function that will display ALL of the persons information on a single line.
Write a program that declares a vector of either employees and customers. You must do this in the same vector (Hint: create a vector of Person).
Prompt the user to specify which type of person's data will be entered or allow the user to quit. While the user chooses to continue, accept data for the appropriate type of person.
Create a NON-Member function that will accept each individual person in the vector as a parameter (not the entire vector) and display their information.
Once the user has finished entering in both employees and customers, use a loop and your NON-member display function to display the contents of your vector.

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions