19 people took this quiz. Three people got 1 point and 3 people got 2 points.
public double getAverage(int[] array) {
int sum = 0;
if (array.length == 0)
return 0.0;
for (int i=0;i<array.length;i++)
sum = sum + array[i];
return sum/(double)array.length;
}