Assume that a bool variable workedOvertime has been declared, and that an int variable hoursWorked has been declared and initialized. Write a statement that assigns the value of workedOvertime to true if hoursWorked is greater than 40 and false otherwise.
.
.
Click on the title for the solution
.
.
if (hoursWorked>40) workedOvertime=true;
else workedOvertime=false;
.
Click on the title for the solution
.
.
This is the answer:
:
if (hoursWorked>40) workedOvertime=true;
else workedOvertime=false;
Comments
Post a Comment