Write a conditional that multiplies the value of the variable pay by one-and-a-half if the value of the boolean variable workedOvertime is true.

Write a conditional that multiplies the value of the variable pay by one-and-a-half if the value of the boolean variable workedOvertime is true.

LANGUAGE: JAVA

CHALLENGE:

Write a conditional that multiplies the value of the variable pay by one-and-a-half if the value of the boolean variable workedOvertime is true.

SOLUTION:


if (workedOvertime == true) pay = pay * 1.5;

Add comment