Method outputBarChart

Method outputBarChart (lines 107–137) is nearly identical to the one in Fig. E.13. However, to output the overall grade distribution for a whole semester, the method here uses nested enhanced for statements (lines 115–119) to create 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 methods that displays the chart is identical.

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.