What does the following code do?
Int sum = 0;
Final int count = 1000;
For (int i = 1; i <= count; i++)
{
Sum = sum + (int) (Math.random() * 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
Q4: What is the output of the following
Q40: In the _ loop header, you can
Q45: What is the output of the following
Q46: What is the output of the following
Q48: What does the following code snippet display?
Char
Q51: How many times does the following loop
Q55: Which of the following for loops is
Q65: Choose the loop that is equivalent to
Q78: What is the output of the code
Q119: What is the last output line of
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents