I remember two important things you said...
The loop control variables names are not well chosen.
...and...
Some of The println statements should be BEFORE the if statements to show the values of the variables BEFORE they are tested and used.
So, I wrote this...
// Use these nested-loops to display the highest sales-division for a quarter.
for (int quarters = 0; quarters < QUARTERS; quarters++)
{
for (int divisions = 0; divisions < DIVISIONS; divisions++)
{
System.out.println("Before first if statement is all this...");
System.out.println("quarters = " + quarters + " & divisions = " + divisions);
System.out.println("salesFigures[quarters][divisions] = "
+ salesFigures[quarters][divisions]
+ " & highestQuart = " + highestQuart);
if (salesFigures[quarters][divisions] > highestQuart)
{
highestQuart = salesFigures[quarters][divisions];
}
}
for (int divisions = 0; divisions < DIVISIONS; divisions++)
{
System.out.println("Before second if statement is all this...");
System.out.println("quarters = " + quarters + " & divisions = " + divisions);
System.out.println("salesFigures[quarters][divisions] = "
+ salesFigures[quarters][divisions]
+ " & highestQuart = " + highestQuart);
if (salesFigures[quarters][divisions] == highestQuart)
{
System.out.println("Inside if-statement, quarters = " + quarters + " & divisions = " + divisions);
}
}
}
...and came up with this below: 7 different highestQuart-values.
Before first if statement is all this...
quarters = 0 & divisions = 0
salesFigures[quarters][divisions] = 456.0 & highestQuart = 0.0
Before first if statement is all this...
quarters = 0 & divisions = 1
salesFigures[quarters][divisions] = 544.0 & highestQuart = 456.0
Before first if statement is all this...
quarters = 0 & divisions = 2
salesFigures[quarters][divisions] = 768.0 & highestQuart = 544.0
Before first if statement is all this...
quarters = 0 & divisions = 3
salesFigures[quarters][divisions] = 976.0 & highestQuart = 768.0
Before first if statement is all this...
quarters = 0 & divisions = 4
salesFigures[quarters][divisions] = 356.0 & highestQuart = 976.0
Before first if statement is all this...
quarters = 0 & divisions = 5
salesFigures[quarters][divisions] = 7876.0 & highestQuart = 976.0
Before second if statement is all this...
quarters = 0 & divisions = 0
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 0 & divisions = 1
salesFigures[quarters][divisions] = 544.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 0 & divisions = 2
salesFigures[quarters][divisions] = 768.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 0 & divisions = 3
salesFigures[quarters][divisions] = 976.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 0 & divisions = 4
salesFigures[quarters][divisions] = 356.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 0 & divisions = 5
salesFigures[quarters][divisions] = 7876.0 & highestQuart = 7876.0
Inside if-statement, quarters = 0 & divisions = 5
Before first if statement is all this...
quarters = 1 & divisions = 0
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 1 & divisions = 1
salesFigures[quarters][divisions] = 876.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 1 & divisions = 2
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 1 & divisions = 3
salesFigures[quarters][divisions] = 776.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 1 & divisions = 4
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 1 & divisions = 5
salesFigures[quarters][divisions] = 776.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 1 & divisions = 0
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 1 & divisions = 1
salesFigures[quarters][divisions] = 876.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 1 & divisions = 2
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 1 & divisions = 3
salesFigures[quarters][divisions] = 776.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 1 & divisions = 4
salesFigures[quarters][divisions] = 456.0 & highestQuart = 7876.0
Before second if statement is all this...
quarters = 1 & divisions = 5
salesFigures[quarters][divisions] = 776.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 2 & divisions = 0
salesFigures[quarters][divisions] = 123.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 2 & divisions = 1
salesFigures[quarters][divisions] = 547.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 2 & divisions = 2
salesFigures[quarters][divisions] = 848.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 2 & divisions = 3
salesFigures[quarters][divisions] = 567.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 2 & divisions = 4
salesFigures[quarters][divisions] = 8923.0 & highestQuart = 7876.0
Before first if statement is all this...
quarters = 2 & divisions = 5
salesFigures[quarters][divisions] = 4567.0 & highestQuart = 8923.0
Before second if statement is all this...
quarters = 2 & divisions = 0
salesFigures[quarters][divisions] = 123.0 & highestQuart = 8923.0
Before second if statement is all this...
quarters = 2 & divisions = 1
salesFigures[quarters][divisions] = 547.0 & highestQuart = 8923.0
Before second if statement is all this...
quarters = 2 & divisions = 2
salesFigures[quarters][divisions] = 848.0 & highestQuart = 8923.0
Before second if statement is all this...
quarters = 2 & divisions = 3
salesFigures[quarters][divisions] = 567.0 & highestQuart = 8923.0
Before second if statement is all this...
quarters = 2 & divisions = 4
salesFigures[quarters][divisions] = 8923.0 & highestQuart = 8923.0
Inside if-statement, quarters = 2 & divisions = 4
Before second if statement is all this...
quarters = 2 & divisions = 5
salesFigures[quarters][divisions] = 4567.0 & highestQuart = 8923.0
Before first if statement is all this...
quarters = 3 & divisions = 0
salesFigures[quarters][divisions] = 457.0 & highestQuart = 8923.0
Before first if statement is all this...
quarters = 3 & divisions = 1
salesFigures[quarters][divisions] = 321.0 & highestQuart = 8923.0
Before first if statement is all this...
quarters = 3 & divisions = 2
salesFigures[quarters][divisions] = 4578.0 & highestQuart = 8923.0
Before first if statement is all this...
quarters = 3 & divisions = 3
salesFigures[quarters][divisions] = 86655.0 & highestQuart = 8923.0
Before first if statement is all this...
quarters = 3 & divisions = 4
salesFigures[quarters][divisions] = 45.0 & highestQuart = 86655.0
Before first if statement is all this...
quarters = 3 & divisions = 5
salesFigures[quarters][divisions] = 78.0 & highestQuart = 86655.0
Before second if statement is all this...
quarters = 3 & divisions = 0
salesFigures[quarters][divisions] = 457.0 & highestQuart = 86655.0
Before second if statement is all this...
quarters = 3 & divisions = 1
salesFigures[quarters][divisions] = 321.0 & highestQuart = 86655.0
Before second if statement is all this...
quarters = 3 & divisions = 2
salesFigures[quarters][divisions] = 4578.0 & highestQuart = 86655.0
Before second if statement is all this...
quarters = 3 & divisions = 3
salesFigures[quarters][divisions] = 86655.0 & highestQuart = 86655.0
Inside if-statement, quarters = 3 & divisions = 3
Before second if statement is all this...
quarters = 3 & divisions = 4
salesFigures[quarters][divisions] = 45.0 & highestQuart = 86655.0
Before second if statement is all this...
quarters = 3 & divisions = 5
salesFigures[quarters][divisions] = 78.0 & highestQuart = 86655.0