float average (float array[], int array_length)
{
  float total, int divider = 0;

  for (i = 0; i < array_length; i, divider ++)
  {
    total += array[i];
  }

  return (divider != 0) ? (total / divider) : 0;
}
