A good answer might be:

The loop (and the program) stops because the user did not type "y".


Example Dialog

The program is a little bit user unfriendly because it insists that the user enter exactly "y" to continue. This problem could be fixed with a few extra statements. But let's not. Here is a sample user dialog with the program:

C:\users\default\JavaLessons\chap18>java evalPoly

Enter a value for x:
-1
The value of the polynomial at x = -1.0 is :-26.0

continue (y or n)?
y
Enter a value for x:
1
The value of the polynomial at x = 1.0 is :-4.0

continue (y or n)?
y
Enter a value for x:
1.178
The value of the polynomial at x = 1.178 is :-0.008209736000004852

continue (y or n)?
yes

C:\users\default\JavaLessons\chap18>

QUESTION 21:

At about what value for x does the polynomial evaluate to zero?