GradeBook Class Source-Code File

Source-code file GradeBook.cpp (Fig. 5.10) contains the member-function definitions for class GradeBook. Lines 11–15 in the constructor initialize the five grade counters to 0—when a GradeBook object is first created, no grades have been entered yet. These counters will be incremented in member function inputGrades as the user enters grades. The definitions of member functions setCourseName, getCourseName and displayMessage are identical to those in the earlier versions of class GradeBook.

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.