Step-by-step explanation:
I would use a for loop cycling through the array and adding the arrays values into a variable, then keep track of how many items in the array you have. Finally divide the total by the amount of stock prices and output it.
1.6m questions
2.0m answers