// CM11 47LoopArray.cpp created by Erica Cummings //This program will create and integer array of 10 elements and use q to quit #include "stdafx.h" #include #define SIZE 10 using namespace std; int index, scores[10]; int n = 0, sum = 0, status; double average; char name[40]; int main() { cout << "Hello, my name is Erica. What is your name?" << endl; cin >> name; cout << "\nWelcome to the golf score calculator, " << name << ". Enter up to golf 10 scores or press q to quit." << endl; for (index = 0; index < SIZE; index++) cin >> scores [index]; for (index = 0; index < SIZE; index++) sum += scores[index]; average = (double)sum / SIZE; cout << "The sum of the scores is " << sum << endl; cout << "The average of your scores is " << average << endl; return 0; }