When will the loop in the following code snippet stop?
Java.util.Scanner in = new java.util.Scanner(System.in) ;
Double sum = 0;
Int count = 0;
System.out.print("Enter values, Q to quit: ") ;
Do
{
Double value = in.nextDouble() ;
Sum = sum + value;
Count++;
System.out.print("Enter values, Q to quit: ") ;
}
While (in.hasNextDouble() && count < 100) ;
I. When the user enters an integer
II. When the user enters an alphabetic character
III. After the user enters 100 numbers
A) I or II
B) II only
C) III only
D) II or III
Correct Answer:
Verified
Q21: What is the output of the code
Q28: Select the statement that correctly completes the
Q45: Which statement about this code snippet is
Q62: Which of the following statements is correct
Q81: What is the output of the code
Q91: How many times does the following loop
Q93: What will be the output of the
Q95: What is the last output line of
Q98: What is the output of this code
Q116: Which for loop prints data across each
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