Multiple Choice
What does the following code do?
Int sum = 0;
Final double count = 1000;
Random generator = new Random() ;
For (int i = 1; i <= count; i++)
{
Sum = sum + generator.nextInt(101) ;
}
System.out.println(sum / count) ;
A) It simulates the outcome of throwing a coin.
B) It calculates the average of 1000 random numbers between 0 and 100.
C) It performs Monte Carlo simulation of fluid dynamics.
D) It calculates the average of 1000 random numbers between 1 and 101.
Correct Answer:

Verified
Correct Answer:
Verified
Q118: What will be the final output of
Q119: Which of the following loop(s) should be
Q120: How many times will the output line
Q121: What is the output of the code
Q122: What is the output of the code
Q123: Which loop does not check a condition
Q124: How many times does the following code
Q126: Which of the loop(s) test the condition
Q127: Which of the following loops executes exactly
Q128: Assume the following variable has been declared