Question: Please need some help in C++ Calculate the Integer Average of an Array. Finish implementation of the findAverage() function started below Call the function from

Please need some help in C++ Calculate the Integer Average of an Array. Finish implementation of the findAverage() function started below Call the function from main() and print its result The answer should be 50, since the fillArray() function will fill the array with normally distributed random values between 1 and 100 (inclusive)

#include #include

using namespace std;

// this function has been provided void fillArray(int arr[], const int N ) { for (int i=0; i< N; i++ ){ arr[i] = rand()%100+1; //cout << arr[i] << ", " << endl; } }

// TODO: finish implementation of this function int findAverage( int arr[], const int N) { // TODO: your code goes here }

int main() { const int arrSize = 1000000; int myArr[arrSize]; fillArray( myArr, arrSize); // call fillArray to fill myArr with arrSize random values // call findAverage() to calculate and return the average of the array // your answer should be 50 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!