Question: C++ Employee Class Program The Employee Class For this project you need to design an Employee class. Your Employee class should have the following data
C++ Employee Class Program
The Employee Class
For this project you need to design an Employee class. Your Employee class should have the following data members:
employeeNumber (integer), name (string), address (string), phone (string), hourlyWage (double), hoursWorked this week (double)
Your Employee class will have the following functions:
A constructor for the Employee class that takes arguments to initialize all of the above mentioned data members.
'Getters' for each data attribute of your class.
Setters for every attribute except employeeNumber. We will not use the setters in this assignment, but in an actual payroll application, employee data, except for the employee number, can change (due to address change, marriage, a raise or promotion etc.).
A function, calcPay() that calculates and returns an employee's net pay. An employee's gross pay is calculated by multiplying the hours worked by their hourly wage. Be sure to give time-and-a-half for overtime (anything over 40 hours). To compute the net pay, deduct 20% of the gross for Federal income tax, and 7.5% of the gross for state income tax.
A function, printCheck() that prints out a pay check for each employee.
The major function of this first exercise is to test your Employee class. You will upload 3 files:
employee.h, employee.cpp, main.cpp
Your main() function does the following.
Creates two Employee objects with data that you can glean from the output below. These objects will be 'hard coded' into your .cpp file. There will be no interactive input for this program.
Calls the needed getter member functions to display the employee's name, number, address, and phone, as shown below.
Calls printCheck() to print the check, which follows the employee's personal information. Note that printCheck calls calcPay, and prints the whitespace that you see below before and after the check portion.
For this project, you will create 3 files: main.cpp, Employee.h, and Employee.cpp. You will place your Employee class definition in Employee.h. The bodies of the Employee member functions go in Employee.cpp.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
