Question: Write a class named Employee, with the class declaration in a file called Employee.h and the implementation in a file called Employee.cpp. The class should

Write a class named Employee, with the class declaration in a file called Employee.h and the implementation in a file called Employee.cpp. The class should have the following data members:

name A string that holds the employees name

idNumber An int variable that holds the employees ID number

department a string that holds the name of the department where the employee works

position A string that holds the employees job status

The class must have the following constructors:

A constructor that accepts the following values as arguments and assigns them to the appropriate number variables: employees name, employees ID number, department and position.

A constructor that accepts the following values as arguments and assigns them to the appropriate member variable: employees name, employees ID number. The department and position fields should be assigned an empty string ( ).

A default constructor that assigns empty string () to the name, department and position member variables and 0 to the idNumber member variable. Write the appropriate mutator functions that store values in these member variables and accessor functions that return the values in these member variables. Once you have written the class, write a separate program that creates 3 instances of the Employee class. Each instance of the class should use a different constructor than the other 2 objects (so all three constructors must be used). Main should use a function called displayEmployee that has one parameter which is a pointer to a constant Employee object. Main will call the function 3 times to display the information for each of the 3 instances of the Employee class.

void displayEmployee(Employee* const e);

The output of the program must be in the form of a table

Write a class named Employee, with the class declaration in a file

C:\Windowslsystem321cmd.exe Name ID Number Department Position Susan Me yers Mark Jones oy Rogers Press any key to continue 47899 39119 81774 Accounting IT Manufacturing Vice President Programmer Engineer

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!