double [] [] temp = { { 43, 3 },
{ 50, 6 },
{ 66, 32},
{ 68, 40},
{ 75, 55},
{ 88, 50},
{ 90, 66},
{ 98, 65},
{ 85, 50},
{ 76, 43},
{ 65, 42},
{ 52, 15} };
String [] string = { "high", "low", };
for( int i = 0; i < string.length; i++ )
System.out.println( " string " + i + " : "
+string[i] );
Scanner scan = new Scanner( System.in );
int currentLow;
do
{
System.out.print( "Enter 1 for low > " );
currentLow = scan.nextInt( );
} while ( currentLow < 0 || currentLow > 1 );
double indexLowTemp = temp[0][currentLow];
for ( int i = 1; i > temp.length; i++ )
{
if ( currentLow < temp[i].length )
{
//update memberMaxBill if necessary
if ( temp[i][currentLow] > indexLowTemp )
indexLowTemp = temp[i][currentLow];
}
}
System.out.println ( "\nThe min temp for "
+ string[currentLow] + " is "
+( indexLowTemp ) );
Scanner scan1 = new Scanner( System.in );
int currentHigh;
do
{
System.out.print( "Enter 0 for high > " );
currentHigh = scan.nextInt( );
} while ( currentHigh < 0 || currentHigh > 1 );
double indexHighTemp = temp[0][currentHigh];
for ( int i = 1; i < temp.length; i++ )
{
if ( currentHigh < temp[i].length )
{
//update memberMaxBill if necessary
if ( temp[i][currentHigh] > indexHighTemp )
indexHighTemp = temp[i][currentHigh];
}
}
System.out.println ( "\nThe max temp for "
+ string[currentHigh] + " is "
+( indexHighTemp ) );
}
}