Is a sentinel always going to be an integer?

A good answer might be:

No, probably not.

New Example

Sometimes the user needs to be explicitly asked whether the loop should continue. The user will enter "yes" or "no" (or maybe "y" or "n"). The sentinel will be of type String or char. The next example illustrates this:

Say that you were interested in the value of the polynomial

7x3- 3x2 + 4x - 12

for various values of x. The value x will be a double precision value. For example, when x == 2.0 the polynomial is equal to:

7*23- 3*22 + 4*2 - 12 = 7*8 - 3*4 + 8 - 12 = 40

You want the user to be able to enter various values for x and see the result.

QUESTION 14:

Would using a special value of x (such as 0.0) as a sentinel work well in this program?