/*	
	Mr. Bui
	10/4/06
	This program finds the mean of a bunch of numbers in an integer array
*/

public class MyFirstArrayProgram
{
	public static void main(String [] args)
	{
		//declares array and allocates memory for it
		int [] myIntArray = new int[20];

		//initializes all values in array to 0
		for (int i = 0; i < myIntArray.length; i++)
		{
			myIntArray[i] = 0;
		}
		
		//fill each element with the square of its index
		for (int i = 0; i < myIntArray.length; i++)
		{
			myIntArray[i] = i*i;
		}
		
		//print out all the elements in the array
		for (int i = 0; i < myIntArray.length; i++)
		{
			System.out.println("myIntArray[" + i + "] => " + myIntArray[i]);
		}		
	}
}

/*
		for (int i = 0; i < myIntArray.length; i++)
		{
			myIntArray[i] = 0;
			myIntArray[i] = i*i;
			System.out.println("myIntArray[" + i + "] => " + myIntArray[i]);
		}	
*/