... student = 0; student < grades.length; student++) {
120           System.out.printf("Student %2d: %3d%n",
121              student + 1, grades[student]);
122        }
123      }
124   }

Fig. 7.15 GradeBookTest creates a GradeBook object using an array of grades, then invokes method processGrades to analyze them.


 1   // Fig. 7.15: GradeBookTest.java
 2   // GradeBookTest creates a GradeBook object using an array of grades,
 3   // then invokes method processGrades to analyze them.
 4   public class GradeBookTest {
 5      public static void main(String[] args) {
 6         // array of student grades                                   
 7         int[] gradesArray = {87, 68, 94, 100, 83, 78, 85, 91, 76, 87};
 8
 9         GradeBook myGradeBook = new GradeBook(
10            "CS101 Introduction to Java Programming", gradesArray);
11         System.out.printf("Welcome to the grade book ...

Get Java How To Program, Late Objects, 11th 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.