Member function processGrades
(declared in line 20 of Fig. 7.15 and defined in lines 38–53 of Fig. 7.16) contains a series of member function calls that output a report summarizing the grades. Line 41 of Fig. 7.16 calls member function outputGrades
to print the contents of the array grades
. Lines 138–140 in member function outputGrades
use a for
statement to output each student’s grade. Although array
indices start at 0, a professor would typically number students starting at 1. Thus, lines 139–140 output student + 1
as the student number to produce grade labels "Student 1: "
, "Student 2: "
, and so on.