Ask Question
10 July, 14:53

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. 10 July, 18:42
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers