computeAverage method

double computeAverage()

Implementation

double computeAverage() {
  try {
    double a = 0;

    for (int i = 0; i < data.length; i++) {
      a += data[i];
    }

    return a / data.length;
  } catch (e) {}

  return 0;
}