throws exception won't permit compilation
Hello, I get the general output errors;
--------------------Configuration: <Default>--------------------
public class monthTempsClient
{
public static void main( String [] args ) throws IOException
{
int belowFreezing = 0;
int above100 = 0;
int[] temperatures = new int [30];
int i = 0;
int bigChange = 0;
File tempsFile = new File( "tempsFile.csv" );
Scanner scan = new Scanner( tempsFile );
while (scan.hasNext ())
{
temperatures[i] = scan.nextInt();
System.out.println( "\nReading temp from file: \t\t\t" + i +
"\t\t\t" + temperatures[i] );
i ++;
}
// make month
monthTemps aprilTemps = new monthTemps ( temperatures );
System.out.println( aprilTemps.toString( ) );
// make another month same as first
monthTemps marchTemps = new monthTemps( temperatures );
System.out.println( marchTemps.toString( ) )
// are months equal?
if ( aprilTemps.equals( marchTemps ) )
System.out.println( "\nThe two months have equal temps\n"
);
else
System.out.println( "\nThe two months do not have equal
temps\n" );
// get temperatures
temperatures = aprilTemps.getTemps( );
System.out.println( "\nApril temperatures: " );
for (i = 0; i < temperatures.length; i++)
System.out.println( "\n " + i + " temperature: " +
temperatures[i] );
// change month's temps
marchTemps.setTemps( temperatures );
// are months equal now?
if ( aprilTemps.equals( marchTemps ) )
System.out.println( "\nThe two months have equal temps\n" );
else
System.out.println( "\nThe two months have different temps\n"
);
// get month's biggest temp change
bigChange = marchTemps.biggestChange( );
System.out.println( "\nThe biggest daily change is " + bigChange
);
// how many > .300 hitters on the home team?
belowFreezing = aprilTemps.belowFreezing( );
System.out.println( "\n " + belowFreezing + " temps were under
freezing" );
// how many total hits does the home team have?
above100 = aprilTemps.above100( );
System.out.println( "\nThe month has " + above100 + " days above
100 degrees." );
}
}
I do have a csv file with integer values separated by commas.
Thanks.....