Well yes, a nested for-loop is required. I'll try and explain it, and you'll try to put it in code okay? :)
You're gonna need this loop -
1 2 3 4 5 6 7 8 9
|
for (int j = 0; j<3; j++)
{
for (int i = 0; i<4; i++)
{
}
}
|
1. Create a float variable just above this for-loop and call it highestSale;
1.1. Create a integer variable and call it highestDivision;
2. Set highestSale to the first value of the multidimensional array.
2.2. Set highestDivision to 0.
3. now inside the for-loop. ask, if the value of the array Im currently in (sales[j][i]) is bigger than highestSale. Then set highestSale equal to the current value of the array.
3.3. in the same for-loop. Set highestDivision to equal j.
And there you go. If you print out highestSale you should get 59. If you print out highestDivision you should get 0, because its the first division. Try doing this and post your code here after :)
P.s. To find the lowest value, you do the same but just switch the if-statement.