// Stuart Reges // 10/18/04 // // This program finds the average score received by each of two athletes. import java.util.*; public class Judge1 { public static void main(String[] args) { System.out.println("This program reads in a series of judges' scores"); System.out.println("for two different athletes and computes an"); System.out.println("average score for each."); System.out.println(); Scanner console = new Scanner(System.in); System.out.println("Enter next athlete information:"); double total = 0; for (int i = 1; i <= 5; i++) { System.out.print(" judge #" + i + " score? "); double score = console.nextDouble(); total += score; } System.out.println(); double score1 = total/5; System.out.println("Enter next athlete information:"); total = 0; for (int i = 1; i <= 5; i++) { System.out.print(" judge #" + i + " score? "); double score = console.nextDouble(); total += score; } System.out.println(); double score2 = total/5; System.out.println("Athlete #1 average score = " + score1); System.out.println("Athlete #2 average score = " + score2); } }