Results 21 to 22 of 22
- 03-28-2012, 06:39 PM #21Member
- Join Date
- Mar 2012
- Rep Power
- 03-28-2012, 06:45 PM #22
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.If you don't understand my response, don't ignore it, ask a question.
- By sim18 in forum New To JavaReplies: 4Last Post: 03-27-2012, 11:47 AM
- By Ben132 in forum New To JavaReplies: 1Last Post: 03-23-2012, 05:09 AM
- By saba2005 in forum New To JavaReplies: 2Last Post: 09-25-2011, 03:48 AM
- By ryozkidz in forum Java AppletsReplies: 0Last Post: 01-20-2011, 11:09 PM
- By deathnote202 in forum New To JavaReplies: 4Last Post: 04-23-2010, 06:03 AM