Class GradeBookTest That Demonstrates Class GradeBook

Figure E.18 creates an object of class GradeBook (Fig. E.17) using the two-dimensional array of ints named gradesArray (declared and initialized in lines 10–19). Lines 21–22 pass a course name and gradesArray to the GradeBook constructor. Lines 23–24 then invoke myGradeBook’s displayMessage and processGrades methods to display a welcome message and obtain a report summarizing the students’ grades for the semester, respectively.

 1   // Fig. E.18: GradeBookTest.java 2   // GradeBookTest creates GradeBook object using a two-dimensional array 3   // of grades, then invokes method processGrades to analyze them. 4   public class GradeBookTest 5   { 6      // main ...

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.