uses Average to get the average of all values of an integer array.