double avg(double array[], int length);