Compute the average grade

I will explain the concept of a sentinel loop with an example.

Suppose I wanted to write a program that I can use 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.

I could write the program such that I could enter all of the grades in the set followed by a so-called sentinel value.

(Cont'd on next slide.)