//File:	ScoreAlt.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 ScoreAlt
{
	public static void main (String [] args)
	{
		//Declare variables
		InputBox in = new InputBox("Average Score");
		int	score,
			sum=0,
			count=0;
			
		//Get input from user
		in.setPrompt("Enter score: (OK to quit)");
		score = in.readInt();
		while (!in.eoi()) //NOT end of input
		{
			count = count + 1; //increment the counter
			sum = sum + score; //accumulate the sum of the scores entered
			
			//Get input from user
			in.setPrompt("Enter score: (OK to quit)");
			score = in.readInt();
		}
		//Output the results
		OutputBox out = new OutputBox("Average Scores");
		out.setSize(300, 100);
		out.println ("The average of the " + count + " scores is: " + sum/count);
	}
}
