Question: This assignment concerns the creation of ten array functions. You may assume that any input array has 5 or less elements. You may also increase

This assignment concerns the creation of ten array functions. You may assume that any input array has 5 or less elements. You may also increase the capacity if you wish. You may NOT assume that the elements have been passed in sorted order (ascending or descending).
Max: Returns the maximum element in the array.
Min: Returns the minimum element in the array.
Sum: Returns the sum of all of the elements in the array.
Product: Returns the product of all of the elements in the array.
Average: Returns the average (mean) of all of the elements in the array.
Range: Returns the range of all of the elements in the array (maxElem - minElem).
Median: Returns the median of all of the elements in the array (the element in the middle position if all of the elements are enumerated in sorted order). If there are an even number of elements in the array, return the average of the middle two elements.
Variance: Returns the variance of all of the elements in the array.
Standard Deviation: Returns the standard deviation of all of the elements in the array.
Swap: swaps the positions of two elements in an array.
In the file below, the scaffolding for both functions is provided, but none of the Input/output has been provided for you. Your assignment is to implement both functions as well as the input and output for both functions as follows:
Enter an integer: 1
Enter an integer: 2
Enter an integer: 3
Enter an integer: 4
Enter an integer: 5
Max: 5
Min: 1
Sum: 15
Product: 120
Average: 3
Range: 4
Median: 3
Variance: 2.5
Standard Deviation: 1.5811388...
Your implementation should match the input/output EXACTLY. And write in C++

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!