/** * Class for creating a template for a simple Java program * * @author Pat Troy: troy AT uic DOT edu */ // Note the name of the class in the following line MUST // match the name of the file. This is stored in a file // named: Template.java public class Lect1129a { public static void main (String[] args) { System.out.println("Begin Java Exection"); System.out.println(""); // put your Java Program here int[] array2; array2 = new int[10]; int i; for ( i = 0 ; i < 10 ; ++i ) { array2[i] = i * 2; } for ( i = 0 ; i < 10 ; ++i ) { System.out.println ("Pos: " + i + ", Value: " + array2[i]); } int sum = 0; for ( i = 0 ; i < 10 ; ++i ) { sum = sum + array2[i] ; } System.out.println("The sum is: " + sum); System.out.println(""); System.out.println("End Java Exection"); } } // end of Template class