The program of Fig. 7.17 creates an object of class GradeBook
(Figs. 7.15–7.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.
3.133.155.216