Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started