Question: Part I - Polymorphism Payroll System Using Inheritance and Polymorphism You need to implement the following header file and classes. Define the following constants in
Part I Polymorphism
Payroll System Using Inheritance and Polymorphism
You need to implement the following header file and classes.
Define the following constants in a header file called Employee.h
FACULTYMONTHLYSALARY
STAFFMONTHLYHOURSWORKED
Implement an abstract class Employee with the following requirements:
Attributes
last name String
first name String
ID number String
Default argument constructor and argument constructors.
Public Methods
putData that displays the following information:
ID Employee number :
Employee name:
pure virtual method monthlyEarning that returns the monthly earning.
Implement a class called Staff extending from the class Employee with the following requirements:
Attribute
Hourly rate
Default argument and argument constructors
Public Methods
@ get and set
The method monthlyEarning returns monthly salary hourly rate times
Implement a class Education with the following requirements:
Attributes
Degree MS or PhD String type
Major Engineering Chemistry, English, etc String type
Research number of researches
Default argument and argument constructors.
Public methods
@ get and set
Implement a class Faculty extending from the class Employee with the following
requirements:
Attributes
Level use enum statement
AS: assistant professor
AO: associate professor
FU: professor
Education object
Default argument and argument constructor
Public Methods
@ get and set
The method monthlyEarning returns monthly salary based on the
faculty's level.
AS faculty monthly salary
AO times faculty's monthly salary
Hours works per month:
Monthly Salary:
Implement a test driver program that creates an array or a vector of class Employees to store the objects Staff, Faculty,
and Partime.
Using polymorphism, display all employees using the method putData.
Use the following data to create Employee objects in your program.
Staff
Last name: Allen
First name: Paita
ID:
Hourly rate: $
Last name: Zapata
First Name: Steven
ID:
Hourly rate: $
Last name:Rios
First name:Enrique
ID:
Hourly rate: $
Faculty
Last name: Johnson
First name: Anne
ID:
Level: Full
Degree: PhD
Major: Engineering
Reseach:
Last name: Bouris
First name: William
ID:
Level: Associate
Degree: PhD
Major: English
Reseach:
Last name: Andrade
First name: Christopher
ID:
Level: Assistant
Degree: MS
Major: Physical Education
Research:
Parttime
Last name: Guzman
First name: Augusto
ID:
Hourly rate: $
Hours worked per week:
Last name: Depirro
First name: Martin
ID:
Hourly rate: $
Hours worked per week:
Last name: Aldaco First name: Marque
ID:
Hours worked per week:
Runtime output
ID Employee number:
Employee name: Paita Allen
Full Time
Monthly Salary:
ID Employee number:
Employee name: Steven Zapata
Full Time
Monthly Salary:
ID Employee number:
Employee name: Enrique Rios
Full Time
Monthly Salary:
ID Employee number:
Employee name: Anne Johnson
Full Professor
Monthly Salary:
ID Employee number:
Employee name: William Bouris
Associate Professor
Monthly Salary:
ID Employee number:
Employee name: Christopher Andrade
Assistant Professor
Monthly Salary:
ID Employee number:
Employee name: Augusto Guzman
Hours work per month:
Monthly Salary:
ID Employee number:
Employee name: Martin Depirro
Hours work per month:
Monthly Salary:
ID Employee number:
Employee name: Marque Aldaco
Hours worked per month:
Monthly Salary:
Total monthly salary for all the parttime staff: $
Total monthly salary for faculty:
Total monthly salary for all staff:
Total monthly salary for all employees: $
Note: I do not provide the monthly salary for faculty and staff so I can verify your answer for grading.
Hint:
Employee emp;
int n;
empn new Staff;
empnnew Faculty;
forint i;imonthlyEarning;
Part II File processing
Create a main function with the following menu:
a add data for an employee from a user
d display data for all employees
w write all employee data to file
r read all employee data from file
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
