CHAPTER 18 — Sentinel Controlled Loops
The previous several chapters have discussed loops,
and counting loops in particular.
The same statements that are used to build counting loops
can be used to build other kinds of loops.
This chapter will look at a kind of loop called a
sentinel controlled loop.
Chapter Topics:
- Sentinel-controlled loops.
- Example programs: adding up a list of integers, and evaluating polynomials.
- Using an if-else statement inside the loop body.
- Matching up if's with else's.
- Using a String value as a sentinel.