// Mr. Minich
// CMPSC 101
// Ch. 10 Demo Program #4
// January 30, 2000 // Purpose - the use of a 2-dimensional array
#include <iostream>
using namespace std; int main() { int studentNum = 0; // Student number   int testNum = 0;      // Test number int tests[6][4]; // 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]; }
} // 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