final int MAX = 10; int[] square = new int[MAX]; for (int i = 0; i <= MAX; i++) square[i] = i * i;
String[5] name; for (int i = 0; i < 5; i++) { System.out.print ("Enter your name: "); name[i] = scan.nextLine(); }
String[] course = new String[5]; course = "CPSC 120";
int numSalaries; Scanner scan = new Scanner (System.in); System.out.print("How many salaries will be entered? "); numSalaries = scan.nextInt(); // create the array double[] salary = new double[numSalaries]; // read in the salaries and find the average for (int i = 0; i < salary.length; i++) { System.out.print ("Enter salary " + (i+1) + ": "); salary]i] = scan.nextDouble(); } // loop to find out how many salaries are above average
char first = '!'; for (int i = 0; i < 4; i++) System.out.println ( (char) (first + i));