Overload function for net pay of three type employees

Need help on an assignment to create and pass overload function for calculating net pay with deduction for 3 type of employees. I got the gross pay function working but have no idea how to do the tax deduction function.

#include <iostream>

using namespace std;
double payRate(double);


int main()
{
double x = 0;
cout<<"**********************************************************"<<endl;
cout<<"* ABC Inc. PayRoll System for ABC Manufacturing *"<<endl;
cout<<"**********************************************************"<<endl;
cout<<payRate(x);
return 0;
}
double payRate(double grossPay)

{
char eType = 0;
double totalPay;
double salaried;
double hourly;
double contracted;
double hr = 0;
double timeWorked;
const double award = 45000.00/52; //total of contract divided by 52 weeks for a one year award
int weeksWorked;
double yrIncome;

cout<<"Enter employee type to determine gross pay(S,H,or C) enter x to exit: "<<endl;
cin>>eType;
if (eType == 's')
{
cout<<"Enter Salaried employee yearly income: "<<endl;
cin>>yrIncome;
salaried = yrIncome/52;
cout<<"The Gross pay for this employee is: $"<<salaried <<endl;
}
if (eType == 'h')
{
cout<<"Enter hourly employee hourly rate: "<<endl;
cin>>hr;
cout<<"Enter hours worked: "<<endl;
cin>>timeWorked;
hourly = hr*timeWorked;
cout<<"The Gross pay for this employee is: $"<<hourly <<endl;
}
if (eType == 'c')
{
cout<<"Enter expect number weeks to work: "<<endl;
cin>>weeksWorked;
contracted = award*weeksWorked;
cout<<"The Gross pay for this employee is: $"<<contracted <<endl;
}
return totalPay;

double payRate(double taxRate)//Stuck here on defining a tax deduction function to work in main.
{
double salaried;
double contracted;
double hourly;


}


}







Topic archived. No new replies allowed.