I have been trying to compile my program but i get these error messages that i can't understand. Please help. these are the error messages I am getting
error: could not convert 'MARITALSTATUS' to 'double&'
error: in passing argument 2 of 'double FEDTAX(double, double&, int, int&)'
err: In function 'double FEDTAX( double, int)':
declaration of 'MARITALSTATUS' shadows a parameter
here is the program
#include<iostream>
#include<string>
using namespace std;// ln 5
// Declaring subfunctions and other global variables.
double FEDTAX(double, double&, int, int&);
double STATETAX(double);
double LOCALTAX(double);
int MARITALSTATUS;//
int main()
{
string FIRSTNAME, LASTNAME;// first and last names of employee.
char MARITALSTATUS;// Marital status of employee.
int CENTS;
double HOURS_WORKED, HOURLY_RATE, GROSS, NET, TAX ;
// declaring hours worked, hourly rate, gross pay, net pay and tax as long numbers.
cout << "Enter the first and last names of your employee: ";
cin >> FIRSTNAME >> LASTNAME;
cout << " Is " <<" " << FIRSTNAME << " " << LASTNAME << " " << "married?( Enter either 1 if married or 0 if not
married): ";
cin >> MARITALSTATUS;
cout << "Enter the number of hours" << " " << FIRSTNAME << " " << LASTNAME << " " << "worked this"<< " " << "week: ";
cin >> HOURS_WORKED;
cout << "Enter your hourly rate: ";
cin >> HOURLY_RATE;
CENTS= HOURS_WORKED*HOURLY_RATE*100;// Calculating pay in cents.
GROSS= CENTS/100.0;
cout << FIRSTNAME << " " << LASTNAME << endl;
cout << HOURS_WORKED << "hours worked at $ " << HOURLY_RATE << "/ hour= $ " << GROSS << endl;
TAX= FEDTAX(GROSS, MARITALSTATUS);
cout << "Federal Taxes= $ " << TAX << endl;
NET= GROSS-TAX;
TAX= STATETAX(GROSS);
cout << "State Taxes = $ " << TAX << endl;
NET= NET-TAX;
TAX= LOCALTAX(GROSS);
cout << "Local Taxes =$" << TAX << endl;
NET= NET-TAX;
cout << "Net Pay =$" << NET << endl;
return 0;
}// end main program
double FEDTAX( double GROSS, int MARITALSTATUS)
{
int CENTS, MARITALSTATUS;
switch(MARITALSTATUS)
{
case '1':
CENTS= 0.12*GROSS*100;
return CENTS/100.0;
break;
case '0':
CENTS= 0.18*GROSS*100;
return CENTS/100.0;
break;
}
}//End FEDTAX
double STATETAX (double GROSS)
{
int CENTS;
CENTS= 0.0307*GROSS*100;
return CENTS/100.0;
}// end STATETAX
.
here are the error messages
double LOCALTAX(double GROSS)
{
int CENTS;
CENTS= 0.030*GROSS*100;
return CENTS/100.0;
}// end LOCALTAX