|
What happens in this program if the user types "yes" in response to the prompt continue (y or n)? A good answer might be:The loop (and the program) will finish, because the user did not type "y". |
Example DialogThe 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\chap15>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\chap15> |
QUESTION 21:At about what value for x does the polynomial evaluate to zero? Click Here after you have answered the question |