Question: What does the following loop compute? Scanner in = new Scanner ( System . in ) ; int sum = 0 ; int count =
What does the following loop compute?
Scanner in new ScannerSystemin;
int sum ;
int count ;
while inhasNextInt
int value innextInt;
if value
sum value;
count;
double result sum count;
Question options:
the average of all the integers in the input
the sum of all the positive integers in the input divided by the number of integers in the input
the average of all the positive integers in the input
the second smallest value in the input
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
