Solved

Which of the Following Will Yield a Pseudorandom Number in the Range

Question 31

Multiple Choice

Which of the following will yield a pseudorandom number in the range [ -5, +5 ) given the following: Random gen = new Random( ) ;


A) gen.nextFloat( ) * 5
B) gen.nextFloat( ) * 10 - 5
C) gen.nextFloat( ) * 5 - 10
D) gen.nextInt( ) * 10 - 5
E) gen.nextInt(10) - 5

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions