Given an array of doubles named values, what does the following code do?

            double total = 0;
            for(double element :  values)
            {
                total = total + element;
            }
            double average = 0;
            if (values.length > 0)
            {
                average = total/values.length;
            }          
          

Calculates the sum and average of the values
  • Fills the array with squares (0, 1, 4, 9,...)
  • Finds the maximum value
  • Finds the minimum value

There are no hints for this question