Motivating Example
Given a list of 0 or more grades (between 0 and 100) followed by -1, print a histogram of the grades, i.e., a table of grades and their frequencies.
grade frequency
0 0
1 0
2 1
� �
99 18
100 13
Is there a program pattern that applies?
What must be done for each grade?
What must be done before reading any grades?
What must be done after reading all grades?
How many separate counters are needed?