//File: Score.java import CSLib.*; //This program asks the user to enter scores between 0 and 100. //The program then outputs the number of scores and the average of the scores. public class Score { public static void main (String [] args) { //Declare variables InputBox in = new InputBox("Average Score"); int score, sum=0; in.setPrompt("How many scores to process?"); int n = in.readInt(); for (int k=1; k<=n; k++) { //Get input from user in.setPrompt("Enter score: "); score = in.readInt(); sum = sum + score; //accumulate the sum of the scores entered } //Output the results OutputBox out = new OutputBox("Average Scores"); out.setSize(300, 100); out.println ("The average of the " + n + " scores is: " + sum/n); } }