Multiple Choice
What does the following loop compute? Scanner in = new Scanner (System.in) ;
Int sum = 0;
Int count = 0;
While (in.hasNextInt() )
{
Int value = in.nextInt() ;
If (value > 0)
{
Sum += value;
Count++;
}
}
Double result = (sum * 1.0) /count;
A) The average of all the integers in the input
B) The sum of all the positive integers in the input divided by the number of integers in the input
C) The average of all the positive integers in the input
D) The second smallest value in the input
Correct Answer:

Verified
Correct Answer:
Verified
Q2: What will be the range of the
Q3: Which of the following activities can be
Q4: Which of the following is considered a
Q5: What is the output of the code
Q6: What is the output of the following
Q7: Which of the following conditions can be
Q8: Is the following code snippet legal? boolean
Q9: What will be the output of the
Q10: Choose the loop that is equivalent to
Q11: What is the output of the following