Implementing Counter-Controlled Repetition
In Fig. 4.8, class ClassAverage’s main method (lines 7–31) implements the class-averaging algorithm described by the pseudocode in Fig. 4.7—it allows the user to enter 10 grades, then calculates and displays the average.