//Calculate current earnings
if (hrworked > 40)
currentearnings = hrwage * hrworked * 1.5;
else currentearnings = hrwage * hrworked;
//Ouput information
output(emplname, currentearnings, ytdearnings, FICAtax, taxwithheld, amtcheck);
system("pause");
return 0;
}
/////////////////////////
void input(string& emplname, double& hrwage, double& hrworked, int& allowance, char& marital, double& prevytdearnings)
{
/*Pre: emplname - reference to employee's name
hrwage - reference to wage per hour
hrworked - reference to hours worked
allowance - reference to withholding allowances
marital - reference to marital status
ytdearnings - reference to previous year-to-date earnings
Post: Nothing
Purpose: Input information from user
*/
cout << "Enter the employee's name: ";
cin >> emplname;
cout << "Enter the hours wage: ";
cin >> hrwage;
cout << "Enter the hours worked: ";
cin >> hrworked;
cout << "Enter the withholding allowances: ";
cin >> allowance;
cout << "Enter the marital status: <Married: M, Single: S>";
cin >> marital;
cout << "Enter the year-to-date earnings: ";
cin >> prevytdearnings;
return;
}
/////////////////////////
//Calculation
double calcFunction(double& currentearnings, double& FICAtax, double& taxwithheld, char& marital, int& allowance, double tax, double& ytdearnings)
{
tax = 0;
/* Pre: currentearnings - reference to current making based on hours wage times hours worked
FICAtax - refernce to FICA tax
taxwithheld - reference to the amount of wages after substracting withholding allowances
marital - reference marital status
allowance - reference to withholding allowance
tax - the income tax withheld
ytdearnings - reference to year-to-date earnings
Post: total of the bill
Purpose: Calculate FICA tax, tax withheld
*/
Try copying the function declaration, then paste it to the function definition so they are the same. It's a good practise to include variable names in the function declaration too: