vendredi 30 avril 2021

I don't know how to make this if statement work

this is the question on the homework: "If the person works, in hours per week, less than or equal to the number of hours in a normal work week, then the income is simply the payrate times hoursWorkedPerWeek."

this is the code i have, it says it's an unreachable statement:

public double getGrossIncome() {
    double income = 0;

    return income;

    if(hoursWorkedPerWeek <= NORMAL_WORK_WEEK){
        income = payRate * hoursWorkedPerWeek;
    }

}

Aucun commentaire:

Enregistrer un commentaire