Question: Assume that a boolean variable workedOvertime has been declared , and that another variable , hoursWorked has been declared and initialized . Write a statement
Assume that a boolean variable workedOvertime has been declared, and that another variable, hoursWorked has been declared and initialized. Write a statement that assigns the value true to workedOvertime if hoursWorked is greater than 40 and false otherwise. This needs to be in Java and......here is what I came up with but it is not correct according to "MyProgrammingLab"....can you help???
//workedOvertime = false; //hoursWorked = 40; if(hoursWorked>40) { workedOvertime = true; }else{ if(hourWorked<=40){ workedOvertime=false; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
