Examlex

Solved

What Does the Following Loop Compute? Scanner in = New

question 1

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;


Definitions:

Related Questions