// Mr. Minich
// CMPSC 101
// Ch. 10 Demo Program #1
// January 30, 2000 // Purpose - the use of an array and computing an average
#include <iostream>
using namespace std; int main() { int position = 0; // position within array int gameScores[3]; // player's game scores for (int i = 0; i <= 2; i++) { cout << "Enter the score of Game " << i + 1 << ": "; cin >> gameScores[i]; } // Notice that (i + 1) must be displayed to account for the // fact that the array begins with index position 0. cout << "Your average score was " << (gameScores[0] + gameScores[1] + gameScores[2]) / 3.0 << endl; return 0; }// end of main