Here are fragments of the code I have so far. My problem is that the min values come up as Integer.MAX_VALUE, instead of the value I want. iSpeedMph and pressure are both one-dimensional integer arrays.
//calculating mins
Integer min = Integer.MAX_VALUE;
int minSpeed = Integer.MAX_VALUE;
int minPressure = Integer.MAX_VALUE;
for(i = 0; i < iSpeedMph.length; i++)
{
if (min > iSpeedMph[i])
{
min = iSpeedMph[i];
minSpeed = iSpeedMph[i];
}
}
min = Integer.MAX_VALUE;
for(i = 0; i < pressure.length; i++)
{
if (min > pressure[i])
{
min = pressure[i];
minPressure = pressure[i];
}
}
...
System.out.printf("%7s%2s%-9s%4s%8s%5s%13.3s%5s%16.2s\n", "Minimum", " ", " ", " ", " ", " ", minPressure, " ", minSpeed);
When I print out the last line, the terminal shows 214 for pressure and 21 for speed, which, without the formatting, means that they are both Integer.MAX_VALUE.