/*	name
	SumArray2.java
	1) Initialize elements in array
	2) Display elements in array
	3) Find sum of elements of an array
	February 2, 2009
*/
public class SumArray2 {
	
	public static void main (String args [] ) {
		final int ARRAY_SIZE = 10;		//constant
		long rndNum [ ] = new long [ ARRAY_SIZE ];  
		// set values in array
		int high = 100, low = 1;
		for ( int i = 0; i < rndNum.length; i++ )}
			rndNum[i] =  Math.round ( (high - low) * Math.random()) + low;
		}
		System.out.println ("Subscript\tValue");
		for ( int i = 0; i < rndNum.length; i++ ){
			System.out.println (i + "\t\t" + rndNum[ i ]) ;
		}
		System.out.println ();
		long total = 0;
		for ( int i = 0; i < rndNum.length; i++ )
			total += rndNum[ i ];
		System.out.println ("Total of array elements is " + total );
	} // main
	
} // SumArray2