January 2014
Intermediate to advanced
736 pages
70h 43m
English
Class GradeBookTest (Fig. C.3) creates an object of class GradeBook (Fig. C.2) and demonstrates its capabilities. Lines 10–11 of Fig. C.3 create a new GradeBook object and assign it to variable myGradeBook. The String in line 11 is passed to the GradeBook constructor(lines 11–14 of Fig. C.2). Line 13 calls myGradeBook’s displayMessage method to display a welcome message to the user. Line 14 then calls myGradeBook’s determineClassAverage method to allow the user to enter 10 grades, for which the method then calculates and prints the average—the method performs the algorithm shown in Fig. C.1.
Read now
Unlock full access