dairysoto4415 dairysoto4415
  • 15-08-2019
  • Computers and Technology
contestada

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.

Respuesta :

ExieFansler ExieFansler
  • 19-08-2019

Answer:

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.

Answer Link

Otras preguntas

While preparing some chicken wings for cooking you observe white fibers connecting the bones and the muscles to bone. What type of fibers are these?.
who greets the speaker and the speakers friends
What’s that answer please
find the solution to the following system by substitution 4x+y=40
What happened when slavery was abolished.
4. Identify the predicate in the sentence. I will read the third paragraph aloud. A. third paragraph B. will read C. I D. will
Help? question below
Which cash crop was the most significant in ninteenth century Texas? A. Cotton B. Corn C. Rice D. Tobacco
How do you write (4)(25)-300 as an addition equation
Comparing and Contrasting After each statement of fact, write the letter of the fact from the Fact Bank provided that makes a comparison or a contrast. 6 Point