Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C++ For this project you need to design an Employee class. Your Employee class should have the following data members empNum (integer) name (string)
In C++
For this project you need to design an Employee class. Your Employee class should have the following data members empNum (integer) name (string) address (string) phone (string) hourlyWage (double) hoursWorked this week (double) Your Employee class will have the following functions 1. A constructor for the Employee class that takes arguments to initialize all of the above mentioned data members. 2 Getters' for each data attribute of your class. They MUST be declared as follows: 3.int getEmployeeNumber) const; const std: :string& getName const; const std: :string& getAddr) const: const std: :string& getPhone () const: double getHourlyWage () consti double getHoursWorked ) const; 4. 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.). However, we will Unit Test all Setters, so they MUST be declared as follows v id setName(c nst std ::string& name); void setAddr (const std::string& address) void setPhone (const std::string& phone) void setHourlyWage (double wage) void setHoursWorked (double hours) 6. A public 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. NOTE: This MUST be declared as a public" function for the Unit Testing to properly work. 7. A function, printCheck() that prints out a pay check for each employee. (This should NOT print out the employee's name, number phone, etc. That is done in main0 using getters.) The major function of this first exercise is to test your Employee class. You will upload 3 files 1. employee.h 2 employee.cpp 3. 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. (You might want to write a function to do this...) 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. Submitting Your Assignment For this assignment you will create and submit 3 files: main.cpp, Employee.h, and Employee.cpp. You will place your Employee class declarations in Employee.h. The bodies (the definitions) of the Employee member functions go in Employee.cpp. Expected output Employee Name: Joe Brown Employee Number: 37 Address: 123 Main St. Phone: 123-6788 $344.38 United Community Credit Union Hours worked: 45.00 Hourly wage: 10.00 Employee Name: Sam Jones Employee Number: 37 Address: 45 East State Phone: 661-9000 Pay to the order of Sam Jones....... . . . . . . . . . . . . . . . . . . . . . . . . . . . . .$271.88 United Community Credit Union Hours worked: 30.00 Hourly wage: 12.50
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started