Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please do this program for C++ Please make sure it works. please read all the cr

ID: 3681907 • Letter: P

Question

Please do this program for C++ Please make sure it works. please read all the criteria and check the grading criteria. please separate the project into 3 files 1) interface.h 2) implementation.cpp 3) testing.cpp the testing file should include the main function and There should only be minimal code in the Test file, just enough to instantiate an object, and invoke the appropriate function(s)

Create a program that calculates and displays (to 2 places ofdecimal) the weekly

gross pay of hourly employees, contract employees, and salaried employees.
? The weekly gross pay of a salaried employee is calculated by dividing the
employee’s annual salary by 52.
? The weekly gross pay of an Hourly employee is calculated as follows:
o If the employee works for 40 hours or less, the gross pay is calculated
by multiplying the number of hours worked by the pay rate.
o If the number of hours worked by the employee exceeds
40hours, but
is not over 50 hours, the employee will receive regular pay for the first
40 hours, and receive time-and-a-half pay for the hours in excess of 40.
o If the number of hours worked by the employee exceeds 50 hours, the
employee will receive regular pay for the first 40 hours,
receivetimeand-a-half
pay for the time between 40 and 50 hours, and receive
double pay for the time over 50 hours.
o An hourly employee must not work more than 60 hours per week.
? The weekly gross pay of a contract employee is calculated by multiplying the
number of hours worked by the pay rate, regardless of the number of hours.
A contract employee must not work more than 50 hours per week.
At the start of the program, you should prompt for, and supply the Federal Tax rate
and the State Tax rate to be used for the hourly and salaried employees. No tax is
withheld from the contract employee’spay check. If 0 is entered for
federal tax
rate, use 10%
forfederal tax rate. If 0 is entered for state tax rate, use 5% for state
tax rate.
In addition to the Gross Pay, calculate and display the following information (all
amounts should be calculated to 2 places of decimal):
Federal Tax
State Tax
Total Tax
Net Pay
Page 2 of 4
Create separate methods for the calculation of gross pay, and each of the above
amounts.
Create three overloaded functions (one each for the Hourly employees, the
contract employees, and the salaried employees).
The Hourly employee function should receive two values (hours worked and pay
rate), the contract employee should receive three values (hours worked, pay rate,
and the ID of the company the contract employee is from), and the Salaried
employee function should receive one value (yearly salary).
Continue to request, calculate and print employee information until there is no
more employee data to be processed. Your program must be able to process
zero employees, to an infinite number of employees.
Demonstrate the use of the following in your solution:
? Function Overloading
? Default arguments
? Two uses of pass-by-reference using reference arguments.
As usual, your solution must be separated into, at least, three source files
(Interface, Implementation, and Test files). There should only be minimal code in
the Test file, just enough to instantiate an object, and invoke the appropriate
function(s).
Submit your source files to the dropbox no later than the deadline (11:59 pm on
Monday, March 28th
, 2016). Late submission penalty: 25 points per day. Only .cpp
and .h files will be accepted. If you submit other types of files, they will be rejected,
and you’ll receive no points for the project.

/D ziad Chegg Study | Guided Sol × ·Homepage-CS 1119-91 × CS-1119-91-CPP-Program × C file:///C:/Users/makho/Downloads/CS_1 119.91-CPP-Programming-Spring-2016-Project-08%20(2).pdf CS 1119-91_CPP_Programming Spring 2016_Project_08 (2).pdf here are the grading criteria for C++ project 8: Compiler errors in your code 2Submitting a one-file solution (all your code in only one 3 Submitting a two-file solution (all your code in only two Program will be rejected. No points -30 points -20 points -10 points Not calculating the salaried employee's gross pay correctly-10 points -10 points source files) Not displaying all amounts to 2 places of decimal 4 Not calculating the hourly emplovee's gross pay correctly Not calculating the contract employee's gross pay correctly-10 points -10 point:s -10 points -10 points -10 points -10 points -10 points 7 8 Not interactively supplying the tax rates Not calculating the Federal tax correctly Not calculating the State tax correctly Not calculating the Total tax correctly Not calculating the Net Pay correctly 10 12 13Not creating a separate function for Gross Pay calculation 14Not creating a separate function for Federal Tax calculation-10 points Ask me anything 11:37 AM 3/26/2016 92%

Explanation / Answer

I have executed it under code blocks IDE.

please add implementation.cpp to your project other wise it show error of redeclaration.

main.cpp

//#include "implementation.cpp"
#include "interface.h"
#include <iostream>

using namespace std;

class Testing
{

public:
int hoursWorked,payRate,idOfCompany;
float yearlySalary;
float fTaxRate,sTaxRate,SEGrossPay,CEGrossPay,HEGrossPay;
float fdTax,stTax;
int i=0;
void readData(){
cout << " Enter Federal Tax Rate : " ;
cin >> fTaxRate;
cout << " Enter State Tax Rate : " ;
cin >> sTaxRate;
fdTax=fTax(fTaxRate);
stTax=sTax(sTaxRate);

cout << " Enter Number of hours worked : " ;
cin >> hoursWorked;

cout << " Enter Pay Rate : " ;
cin >> payRate;
cout << " Enter Company ID of the Contract Employee : " ;
cin >> idOfCompany;
cout << " Enter Yearly salary of the salaried employee : " ;
cin >> yearlySalary;

CEGrossPay=grossPay(hoursWorked,payRate,idOfCompany);
SEGrossPay=grossPay(yearlySalary);
HEGrossPay=grossPay(hoursWorked,payRate);
if(CEGrossPay==1)
{
cout << " ERROR ! For Contract Employee 50 hours per week is MAXIMUM :" ;

}
i=0;
if(HEGrossPay==1)
{
cout << " ERROR ! hours should not exceed " ;

}

cout << " Gross Pay for Hourly Employee : " <<HEGrossPay<< " and FEDERAL TAX : "<<fdTax*HEGrossPay << "State Tax : "<<stTax*HEGrossPay<<endl;
cout << " Gross Pay for Contract Employee : " <<CEGrossPay<< " and FEDERAL TAX : "<<fdTax*CEGrossPay << "State Tax : "<<stTax*CEGrossPay<<endl;
cout << " Gross Pay for Salaried Employee : " <<SEGrossPay<< " and FEDERAL TAX : "<<fdTax*SEGrossPay << "State Tax : "<<stTax*SEGrossPay<<endl;

}
};
int main()
{
Testing t;
do{


t.readData();
cout << "For next EMPLOYEE:"
}while(true);
return 0;
}

header file:

float grossPay(int,int);
float grossPay(int,int,int);
float grossPay(int);
float fTax(int);
float sTax(int);

implementation.cpp:

//#include <stdio.h>
//#include <iomanip>


float fedaralTax,stateTax;
float fTax(int t)
{
if ( t == 0)
{
return (10 % 100);
}
else
{
return (t % 100);
}

}
float sTax(int s)
{
if ( s == 0)
{
return (5 % 100);
}
else
{
return (s % 100);
}
}

float grossPay(int hWorked,int pRate)
{
float gPay;

if(hWorked <= 40)
return hWorked * pRate;
else if(hWorked > 40 && hWorked < 50)
{
gPay = 40 * pRate;
gPay = gPay + (gPay * pRate / 2);
return gPay;
}
else if( hWorked > 50 && hWorked < 60)
{
gPay = 40 * pRate;
gPay = gPay + (9 * pRate / 2);
gPay = (hWorked - 50) * (pRate * 2);
return gPay;
}
else
return 1;
}
float grossPay(int hWorked,int pRate,int idOfCompany)
{

if(hWorked < 50 )
{
return hWorked*pRate;
}
else
{
return 1;
}
}
float grossPay(int yearlySalary)
{
return yearlySalary/52;
}