//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, count=0; while (true) { //Get input from user in.setPrompt("Enter score: (OK to quit)"); score = in.readInt(); if (in.eoi()) { break; // out of the loop } count = count + 1; //increment the counter 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 " + count + " scores is: " + sum/count); } }