//File:	NumberList.java
import iostuff.*;
public class NumberList
{
	//The following method finds the smallest item in a list of integers
	public static int smallest (int [] list)
	{
		int smallestSoFar;
		
		//The following focuses on smallestSoFar,
		//a variable that is compared with each item
		//in the list in succession.  As smaller items
		//are encountered, they are assigned to the variable
		//smallestSoFar.
		smallestSoFar = list[0];
		for (int k=1; k<list.length; k++)
		{
			if (list[k] < smallestSoFar)
			{
				smallestSoFar = list[k];
			}
		}
		return smallestSoFar;
	}
	
	//The following method outputs to the screen a list of integers
	public static void display (int [] list)
	{
		for (int k=0; k<list.length; k++)
		{
			System.out.println (list[k]);
		}
	}
	
	public static int average (int [] a)
	{
		int sum=0;
		for (int k=0; k<a.length; k++)
		{
			sum = sum + a [k];
		}
		return sum/a.length;
	}
	
	public static double average (double [] a)
	{
		double sum=0;
		for (int k=0; k<a.length; k++)
		{
			sum = sum + a [k];
		}
		return sum/a.length;
	}
	
}