What is a sentinel loop?
A sentinel loop is a loop that continues looping until some value (the sentinel) matches a predefined value.
Example: Suppose I need a program to compute the average of a set of student grades.
Each time I run the program, the number of grades in the set is likely to be different.
The program can sequentially enter all of the grades in the set followed by a so-called sentinel value.
The program will continue reading, adding, and counting grades until I enter the sentinel value.
When I enter the sentinel value, the program will: