I'm getting errors when I try to compile this code:
public class EmployeePayRoll
{
/*** Class Constants ***/
/*** Defaults ***/
public static final String DEFAULT_EMPLOYEE_NAME = "Employee";
public static final double DEFAULT_PAY_RATE = 10.00;
public static final double DEFAULT_HOURS_WORKED = 40.0;
/*** Minimums/Maximums ***/
public static final double MINIMUM_PAY_RATE = 7.25;
public static final double MAXIMUM_PAY_RATE = 20.00;
public static final double MINIMUM_HOURS_WORKED = 0.0;
public static final double MAXIMUM_HOURS_WORKED = 168.0;
/*** Instance Variables***/
private String employeeLastName;
private double hoursWorked;
private double payRate;
/*** Constructors ***/
public EmployeePayRoll( String employeeName, double hours )
{
employeeLastName = employeeName;
hoursWorked = setHoursWorked( hours );
payRate = DEFAULT_PAY_RATE;
}
public EmployeePayRoll( String employeeName, double hours, double hourlyRate )
{
employeeLastName = employeeName;
hoursWorked = setHoursWorked( hours );
payRate = setPayRate( hourlyRate );
}
/*** Mutators ***/
public void setHoursWorked( double hours )
{
if ( verifyHoursWorked ( hours ) )
hoursWorked = hours;
else
hoursWorked = DEFAULT_HOURS_WORKED;
}
public void setPayRate( double hourlyRate )
{
if ( verifyPayRate ( hourlyRate ) )
payRate = hourlyRate;
else
payRate = DEFAULT_PAY_RATE;
}
/*** Accessors ***/
public double getHoursWorked()
{
return hoursWorked;
}
public double getPayRate()
{
return payRate;
}
public double getGrossPay()
{
return hoursWorked * payRate;
}
/*** Helper Methods ***/
public boolean verifyPayRate( double hourlyRate )
{
boolean payRateVerification = false;
if ( hourlyRate >= MINIMUM_PAY_RATE )
{
if ( hourlyRate <= MAXIMUM_PAY_RATE )
{
payRateVerification = true;
}
}
return payRateVerification;
}
public boolean verifyHoursWorked( double hours )
{
boolean hoursVerification = false;
if ( hours >= MINIMUM_HOURS_WORKED )
{
if ( hours <= MAXIMUM_HOURS_WORKED )
{
hoursVerification = true;
}
}
return hoursVerification;
}
}
I get three "incompatible types" errors... one one line 30, one on line 37, and one on line 38. I read a little about other people's incompatible types errors but I don't understand why I'm getting that error here. Any help would be greatly appreciated.