As part of an assignment, I am to create a function to complete the program....I am very new to arrays and would like a little help, code as follows
// NAME:
// ASSIGNMENT: pj70101 - ComputeAverage Function
// COURSE:
#include <iostream>
#include <iomanip>
using namespace std;
//=========================================================
// put your function prototype here - MUST be one function.
//=========================================================
const int MAX_ARRAY_SIZE = 15;
double computeAverage(double x[],double y[], double z[], const int SIZE);
int main()
{//DO NOT CHANGE ANYTHING IN THIS FUNCTION.
double x[] = { 11.11, 66.66, 88.88, 33.33, 55.55 };
double y[] = { 9, 6, 5, 8, 3, 4, 7, 4, 6, 3, 8, 5, 7, 2 };
double z[] = { 123, 400, 765, 102, 345, 678, 234, 789 };
cout << fixed << showpoint << setprecision(2);
double avg1 = computeAverage (x, sizeof (x) / sizeof (x[0]) );
double avg2 = computeAverage (y, sizeof (y) / sizeof (y[0]));
cout << "Average of numbers in array x = " <<setw(7) << avg1 << '\n';
cout << "Average of numbers in array y = " <<setw(7) << avg2 << '\n';
cout << "Average of numbers in array z = " <<setw(7)
<< computeAverage (z, sizeof (z) / sizeof (z[0])) << '\n';
return 0;
}
//====================================================================
// put your function definition here - MUST be one function definition
//====================================================================
double computeAverage(int Array[], const int SIZE)
{
int sum =0;
double avg;
sum = ComputeAverage(Array, SIZE);
if( SIZE > 0 )
avg = sum / SIZE;
else
avg = 0;
return avg;
}
I currently get the error c2660 the function does not take 2 arguments for line 24....any help?