a) Write a function named fillArray() to fill the array with random numbers between 0 and SIZE inclusive. NOTE: the numbers in your array should contain fractional parts.
b) Write a function named printArray() to output the array to the console.
c) Write a function named bubbleSort() that will order all elements in the array in decreasing order.
d) Write a function named swap() which will swap any 2 elements in the array. This function should be used by bubbleSort().
e) Write a function named sumElements() that finds the sum of all the elements in the array and returns it.
f) Write a function named avgElements() that finds the average of all the elements in the array and returns it as a double. This function should use sumElements().
Here is the sample output:
Random array: 0.8, 3.8, 1, 3, 0.2
Sorted array: 3.8, 3, 1, 0.8, 0.2
Sum of elements: 8.8
Average of elements: 1.76
Press any key to continue.
int main()
{
const int SIZE = 5;
double array[SIZE];
srand(time(0));
fillArray(array, SIZE);
cout << "Random array: ";
printArray(array, SIZE);
bubbleSort(array, SIZE);
cout << "Sorted array: ";
printArray(array, SIZE);
cout << "Sum of elements: " << sumElements(array, SIZE) << endl;
cout << "Average of elements: " << avgElements(array, SIZE) << endl;
return 0;
}