// ComputeMean.java // Compute and report the mean of the integers // given as command-line arguments public class ComputeMean { public static void main(String[] args) { if (args.length == 0) { System.out.println("No arguments specified."); } else { double sum = 0; for (int i = 0; i < args.length; i++) { sum += Integer.parseInt(args[i]); } System.out.println("Mean is " + sum / args.length); } } }