Testing Class GradeBook

The program of Fig. 7.17 creates an object of class GradeBook (Figs. 7.157.16) using the int array grades (declared and initialized in lines 11–12). The scope resolution operator (::) is used in the expression “GradeBook::students” (line 11) to access class GradeBook’s static constant students. We use this constant here to create an array that’s the same size as the array stored as a data member in class GradeBook. Line 13 declares a string representing the course name. Line 15 passes the course name and the array of grades to the GradeBook constructor. Line 16 displays a welcome message, and line 17 invokes the GradeBook object’s processGrades member function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.155.216