/* * File: GymnasticsMean.java * -------------------------- * This file reads in an array of scores and computes the * average. */ import acm.program.*; public class GymnasticsMean extends ConsoleProgram { public void run() { double[] scores = new double[N_JUDGES]; for (int i = 1; i <= N_JUDGES; i++) { scores[i - 1] = readDouble("Enter score for judge " + i + ": "); } println("The average score is " + mean(scores)); } /** * Calculates the mean of a double array * @param array An array of doubles * @return The mean of the array */ public double mean(double[] array) { } /* Number of judges, private constant */ private static final int N_JUDGES = 5; }