1. Member
Join Date
Mar 2012
Posts
34
Rep Power
0

## Re: Already finished 1-5. Wondering if Someone can help with Steps 6-9. Please & Than

ok so that's the start of the loop. Would this loop here give me the largest value in the values array?
for(int i =0; i < values.length; i++);
{
int maxValue= values[maxIndex+1];
}

2. ## Re: Already finished 1-5. Wondering if Someone can help with Steps 6-9. Please & Than

No, your loop does nothing useful.
I don't know what the value of the maxIndex variable is. What value is in the array when you index the array using:(maxIndex+1)? why do you add one to maxIndex?

It could be the max value in the array. For example say the max value in the array is the value at index 2, then if maxIndex was = 1 then values[maxIndex+1] would be the max value.
But this has nothing to do with the problem of looking at all the elements in the array and finding the max value.
You will need to use an if statement to compare the values.

Page 2 of 2 First 12

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•