having trouble getting this to work correctly. the question is write a function called calcMean that accepts an array of doubles named data and returns the simple average (mean) of the data elements.
this is what I have so far.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
double calcMean(double A[], int arraySize)
{
double data = 0;
for (int i =0; i < arraySize; i++)
data += A[i];
double mean = data/arraySize;
return mean;
}