Question: Which statement, inserted at the indicated blank line, will correctly terminate this loop when the end of input is reached ( detected when the user

Which statement, inserted at the indicated blank line, will correctly terminate this loop when the end of input is reached (detected when the user enters the letter Q)?
ArrayList data = new ArrayList();
boolean done = false;
while (!done)
{
String input = in.next();
if (input.equalsIgnoreCase("Q"))
{
__________
}
else
{
double x = Double.parseDouble(input);
data.add(x);
}
}
Question 1 options:
stop;
done =1;
exit;
done = true;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!