// Mr. Minich
// CMPSC 201 // Ch. 11 Demo Program #5
// January 20, 2000
// Purpose - to illustrate the use of a two-dimensional array.
#include <iostream>
using namespace std; int main() { int studentNum = 0; // student ID number   int testNum = 0;      // test number int tests[6][4]= {0}; // 2-D array of student test scores
for (studentNum = 1; studentNum <= 5; studentNum++) { for (testNum = 1; testNum <= 3; testNum++) { cout << "Enter the score for student #" << studentNum << ", Test #" << testNum << ": "; cin >> tests[studentNum][testNum]; }// end of for (testNum)
} // end of for (studentNum) // The zero column and the zero row of the two-dimensional array
// are not assigned values above.

cout << "Enter a student number: "; cin >> studentNum; cout << "The test scores for student number " << studentNum << " are: "; for (int i = 1; i <= 3; i++) // displaying test scores of selected student {
   cout << tests[studentNum][i] << " "; }

return 0; }// end of main