/* Project3.java Arrays, File input and methods Read the comments and insert your code where indicated. Do not modify any output statements */ import java.io.*; import java.util.*; public class Project3 { public static void main (String[] args) throws Exception { final int ARRAY_MAX = 30; // we will not run this porogram on a file with more that 30 values in it // "args" is the list of tokens you put after "java Project3" on command line if (args.length == 0 ) // i.e forgot to add filename after "java Project3" on command line { System.out.println("FATAL ERROR: Must type a filename on cmd line\n" + "Like this: Java Project3 P3input2.txt"); System.exit(0); //ABORT program. Make user try again with a filename this time. } Scanner infile = new Scanner( new File(args[0]) ); int[] array = new int[ARRAY_MAX]; int count=0; while ( infile.hasNextInt() ) array[count++] = infile.nextInt(); // POST increment NOT pre. Do you see why? System.out.println( "array capacity: " + array.length + "\narray count: " + count); printArray( array, count ); // ECHO ALL (count) ELEMENTS ON ONE LINE System.out.println("The sum of the numbers in array is: " + calcSum( array, count ) ); System.out.println("The INDEX of the minimum value in array is: " + indOfMin( array, count ) ); System.out.println("The minimum value in array is: " + minVal( array, count ) ); System.out.println("The INDEX of the maximum value in array is: " + indOfMax( array, count ) ); System.out.println("The maximum value in array is: " + maxVal( array, count ) ); System.out.println("The average of the numbers in array is: " + calcAverage( array, count ) ); } // END main // GIVEN AS IS: DO MOT MODIFY Or DELETE static void printArray( int[] a, int cnt ) { System.out.print( "array elements: "); for ( int i=0 ; i