Computer Science, asked by Imaginator15, 5 months ago

A student in correctly attempted to produce random value in the range 1.6 using the expression.

6* ( int ) Math.random ( ) + 1

Correct the error in expression above to get the desired result.

Please answer only if you know.
No spams please.......
Otherwise I have to report the answer ​

Answers

Answered by rohitkhajuria90
1

Explanation:

The expression

6* ( int ) Math.random ( ) + 1. 6

Will always give the output 1.6

The expression

1+Math.random()*0.5

Will give output between 1.0 to 1.6

The expression

6-Math.random()*5

Will give output between 1 and 6

Similar questions