if you want to practice using an array to do this, then you need to fill the array with values once you obtain the upper and lower bounds. Using a loop with two variables to do this works well:

int valueCounter = lower;
int arrayIndex = -1;

then loop using valueCounter over the range 0 to <= upper.
in the loop body first increment arrayIndex and then assign the vaule of the current valueCounter to the current element of the array, array[arrayIndex]

To sum over the array declare an int called sum and initialize sum to zero. then loop through the array using a third int called i over the range 0 to <= arrayIndex adding each successive element, array[i], to sum in the body of the loop.

When the loop is over, divide sum by the number of elements in the array (the number of elements in the array is arrayIndex + 1 with this techique). The result should be stored or returned as a type double or type float.