I have already wrote the main funstion but I cannot figure out what to put in the other function to find the average of the three arrays?#include <iostream>
#include <iomanip>
using namespace std;
double avg1( double [], int);
double avg2( double [], int);
double avg3( double [], int);
double computeAverage(int [], double []);
int main()
{
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 << setprecision(2);
double avg1 = computeAverage (x, sizeof (x) / sizeof (x[0]) );
double avg2 = computeAverage (y, sizeof (x) / sizeof (x[0]));
cout << "Average of numbers in array x = " << avg1 << '\n';
cout << "Average of numbers in array y = " << avg2 << '\n';
cout << "Average of numbers in array z = "
<< ComputeAverage (z, sizeof (z) / sizeof (z[0])) << '\n';
return 0;
}
double computeAverage ()
{
}
Any help would be appreciated.
Thanks,
Nate2430