Ask Question
25 October, 12:30

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.

+4
Answers (1)
  1. 25 October, 12:40
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers