I am getting this error message:
2 errors found:
Error: The method determineTaxRate(double) in the type PayCalculator is not applicable for
You haven't specified arguments for the methods which you are calling from printData()
method, for example:
System.out.println("Net Pay: " + calculateNetPay());
You are calling calculateNetPay()
with 0 arguments, where as in your method defnition you have specified, it needs 2 double arguments.
public double calculateNetPay(double grossPay, double tax) { ... }
Same applies for other errors you are getting.
you have declared your method like this :
public double determineTaxRate(double grossPay)
and later invoke it like this :
determineTaxRate()
obviously,you have missed a parameter when invoking the method
fix this by determineTaxRate(someDoubleVar)
your method defined with one argument.But you are not passing any parameters.
For calculateNetPay() also you are doing the same thing.
You are calling
determineTaxRate()
But your method is defined as this:
public double determineTaxRate(double grossPay)
{
Same with your other error. You need to pass a double
to the method. Such as this:
determineTaxRate(calculateGrossPay())