Question: Exercise 22: Write a program that creates three random double variables a, b, and c and assigns them values between 0 and 1 using the

  1. Exercise 22: Write a program that creates three random double variables a, b, and c and assigns them values between 0 and 1 using the Math.random( ) method mentioned in the preceding exercise. It then does all of the following:

    1. It prints out the three values.

    2. It prints "All are tiny" if all three values are less than 0.5.

    3. Extra: It prints out "One is tiny" if exactly one of the three values is less than 0.5.

    4. Extra: It prints out "Only two are tiny" if exactly two of the three values are less than 0.5.

Extra: it prints if None is tiny if none of the values are less than 0.5.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!