Findaverage will return the average of the number of the


Computer science assignment

Write a complete C++ program that will randomly generate 20 integers between the ranges 60 - 100 and store the result in an array. The program should consists of the following functions to test out the array:

a. FindMax will return the largest number of the array.

b. FindMin will return the smallest number of the array.

c. FindAverage will return the average of the number of the array.

d. FindMinGap will return the smallest gap in between the adjacent entries of the array. (A gap between two numbers is the absolute value of their difference)

e. FindGapSum will return the sum of gaps between adjacent entries of an array.

The main program should be similar to below:

int main() {

int array[20] = { };

// initialize all the value of the array;

cout << findMax(array, 20) << endl;

cout << findMin(array, 20) << endl;

cout << findAverage(array, 20) << endl;

cout << findMinGap(array, 20) << endl;

cout << findGapSum(array, 20) << endl;

}

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Findaverage will return the average of the number of the
Reference No:- TGS01412634

Now Priced at $30 (50% Discount)

Recommended (92%)

Rated (4.4/5)