Answer:
The value of average is 11
Explanation:
Analyzing the program line by line
This line initializes sum to 0
var sum = 0;
This line defines an array named prices and it also fills it with integer values.
var prices = [14, 10, 9, 12, 11, 14, 10, 8];
The italicized lines is an iteration that adds every element of prices and saves the result in variable sum
<em>for( var i = 0; i < prices.length; i++ ) { </em>
<em>sum = sum + prices[i]; </em>
<em>}</em>
At this point, the value of sum is 88
The next line divides the value of sum (88) by the length of the array (8) which gives 11.
11 is then saved in variable average
var average = sum/prices.length;