99
100 // Print the array
101 void printArray( int grades[][ exams ], int pupils, int tests )
102 {
103 // set left
justification and output column heads
104 cout
<< left << "
[0] [1] [2]
[3]";
105
106 // output grades in
tabular format
107 for ( int i = 0; i < pupils; i++ )
{
108
109 // output label for row
110 cout
<< "\nstudentGrades[" << i << "] ";
111
112 // output one grades
for one student
113 for ( int j = 0; j < tests; j++ )
114 cout
<< setw( 5 ) << grades[ i ][ j ];
115
116 } // end outer for
117
118 } // end function printArray