Write the function double compute_npay(double gpay) that receives an employee's gross pay using the value parameter gpay, computes the net pay and returns it. the net pay is the gross pay - the tax deduction. To compute the net pay, it first calls compute_taxes() to compute the tax deduction.
the compute taxes function takes an argument double gpay
on line 16 you call compute_taxes();
By only using () and nothing inside of the parenthesis, you are passing no arguments.
just because "gpay" is visible to compute_npay, does not mean that comput_taxes sees it.
you need to compute_taxes(gpay);
double compute_taxes(double gpay)
{
// double gross; //Im guessing you mean gpay, but do not redefine it
if (gpay <= 1000)
return gpay * 0.5;
elseif(gpay < 1500)
return gpay * 0.6;
elsereturn gpay * 0.7;
}
double compute_npay(double gpay)
{
//double gross; Unused
double npay, td;
td = compute_taxes(gpay);
npay = gpay - td;
return npay; //Probably what you need to do here
}