// 8.4Execrcies6a.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include using namespace std; int main() { int amount = 1; double totalScore = 0, avg; cout << "Input the number of assignments: "; cin >> amount; for (int i = 1; i <= amount; i++) { cout << "Input the next score: "; double score; cin >> score; totalScore += score; } if (amount < 1) { amount = 1; } avg = totalScore / amount; cout << "The average score is " << avg << "."; }