O'Reilly logo

C++11 for Programmers, Second Edition by Harvey M. Deitel, Abbey Deitel, Paul J. Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing Student Grades in an array in Class GradeBook

Figure 7.14 shows the output that summarizes the 10 grades we store in an object of the next version of class GradeBook (Figs. 7.157.16), which uses an array of integers to store the grades of 10 students for a single exam. This eliminates the need to repeatedly input the same set of grades. array grades is declared as a data member in line 28 of Fig. 7.15—therefore, each GradeBook object maintains its own set of grades.

Welcome to the grade book forCS101 Introduction to C++ Programming!The grades are:Student  1:  87Student  2:  68Student  3:  94Student  4: 100Student  5:  83Student  6:  78Student  7:  85Student  8:  91Student  9:  76Student 10:  87Class average ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required