Ask Question
30 August, 05:17

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

+1
Answers (1)
  1. 30 August, 07:44
    0
    workedOvertime==true? pay=pay*1.5 : pay;

    Explanation:

    Above written statement is written by using the conditional operator. Conditional operator uses? :. The expression written on the left is evaluated if it comes out to be true then the written to the left of : and to the right of? will be executed if it is false then the expression on the right of : will be executed. In above expression If workedOver time is true then pay will be multiplied ny 1.5 else it does not do anything.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a conditional that multiplies the values of the variable pay by one-and-a-half if the value of the boolean variable workedOvertime is ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers