function call, header, and prototypes!

I'm writing a code for the problem below and I have two issues
a- function header, prototypes, and call
b- I'm getting this message:
There is not enough space on the disk

The problem is :
Write a program that dynamically allocates an array large enough to hold a number of test score. The size of the array should be input by the user. Once all the scores are entered, the array should be passed to a function that calculates the average score and returns the average. The main function should display the average. Do not accept negative numbers for test scores


and this is my code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//

# include <iostream>
# include <iomanip>
using namespace std ; 

void average (double [], int);    //<<===============================================================
int main () 
{
	double *scores;
	int numScores, count;

	cout << " Please enter the number of test score"<< endl;
	cin >> numScores;


	if (numScores<=0)
		{
		return NULL;
		}

	scores= new double [numScores];
	cout << " Enter the score for each test " << endl;

	for (count =0; count < numScores,; count ++)
	{
		cout<< " Score " << (count+1) << " :" ;
		cin >> scores[count];
	}
	average(scores,numScores );   //<<=============================================================== 
	delete [] scores ;
	scores = 0; 
	return 0;
}


void average (double scores, int numScores)    //<<===============================================================
{
	int total =0;
	for (int count =0 ; count< numScores; count ++)
	{
		total += scores [numScores];
	}

	int avg = total/ numScores;
	cout << " The average of the scores is : " << avg << endl;
}



Thanks in advance!
Last edited on
Topic archived. No new replies allowed.