Class GradeBookTest That Demonstrates Class GradeBook

The application of Fig. 7.15 creates an object of class GradeBook (Fig. 7.14) using the int array gradesArray (declared and initialized in line 10). Lines 12–13 pass a course name and gradesArray to the GradeBook constructor. Lines 14–15 display a welcome message that includes the course name stored in the GradeBook object. Line 16 invokes the GradeBook object’s processGrades method. The output summarizes the 10 grades in myGradeBook.

Image Software Engineering Observation 7.2

A test harness (or test application) is responsible for creating an object of the class being tested and providing it ...

Get Java™ How To Program (Early Objects), Tenth 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.