Member function outputBarChart
in Fig. 7.23 is nearly identical to the one in Fig. 7.16. However, to output the overall grade distribution for a whole semester, the function uses a nested for
statement (lines 116–118) to increment the elements of the one-dimensional array frequency
based on all the grades in the two-dimensional array
. The rest of the code in each of the two outputBarChart
member functions that displays the chart is identical.