Testing Class GradeBook

The program in Fig. 7.24 creates an object of class GradeBook (Figs. 7.227.23) using the two-dimensional array of ints named grades (declared and initialized in lines 11–21). Line 11 accesses class GradeBook’s static constants students and tests to indicate the size of each dimension of array grades. Lines 23–24 pass a course name and grades to the GradeBook constructor. Lines 25–26 then invoke myGradeBook’s displayMessage and processGrades member functions to display a welcome message and obtain a report summarizing the students’ grades for the semester, respectively.

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

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