//File:  Average.java
import NumberList;
import iostuff.*;
import java.text.DecimalFormat;
public class Average
{
	public static void main (String [] args)
	{
		double number [];
	
		System.out.print ("How many numbers? ");
		int n = Keyboard.readInt();
	
		number = new double [n];
		
		//Inputs the numbers into the array
		for (int k=0; k<n; k++)
		{
			System.out.print("Next score please: ");
			number [k]= Keyboard.readInt();
		}

		//The following code displays the list to the screen
		for (int k=0; k<number.length; k++)
		{
			System.out.println (number[k]);
		}
		System.out.println();

		double avg = NumberList.average(number);
		
		DecimalFormat output = new DecimalFormat("0.00");
		System.out.println ("The average is: " + output.format(avg));
	}
}