Hi guys. I am trying to write a program that asks the user how many test scores they have, then reads the test scores, averages them, then displays the average and a pass/fail grade (50+ is a pass), using a seperate function to average the input values.
I have been working on it for about 3 hours now, and I don't even know if I am going in the right direction. Worse, I don't know how to proceed. I have the program asking for the number of test scores, and reading the test scores. I have no idea how to write the function to average them.
Any help would be greaty appreciated:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << "This program computes the average of a set of test scores."<<endl;
cout << "How many test scores would you like to average? ";
int numValues;
cin >> numValues;
for (int count = 1; count <= numValues; count++)
{
cout << "\nEnter the test score: ";
int n;
cin >> n;
}
}