Storing Student Grades in a Two-Dimensional Array in Class GradeBook

Figure E.17 contains a GradeBook class that uses a two-dimensional array grades to store the grades of a number of students on multiple exams. Each row of the array represents a single student’s grades for the entire course, and each column represents the grades of all the students who took a particular exam. Class GradeBookTest (Fig. E.18) passes the array as an argument to the GradeBook constructor. In this example, we use a ten-by-three array for ten students’ grades on three exams. Five methods perform array manipulations to process the grades. Each method is similar to its counterpart in the earlier one-dimensional array version of GradeBook (Fig. E.13). Method getMinimum ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.