vendredi 30 avril 2021

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

this is the homework question: "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:

public double getGrossIncome() {
    double income = 0;

    return income;

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

}

Aucun commentaire:

Enregistrer un commentaire