This is not a homework service. I've posted a couple links and gave you plenty of hints. Work with them, throw together an SSCCE, and ask a specific question, and we'll go from there.
Type: Posts; User: KevinWorkman
This is not a homework service. I've posted a couple links and gave you plenty of hints. Work with them, throw together an SSCCE, and ask a specific question, and we'll go from there.
If you understand that arrays start at zero, why are you starting your indexes at one? If you understand that they go to array.length - 1, why are you trying to access array.length?
You have the right idea, you just aren't keeping in mind that arrays start at index 0. Zero is the first index, one is the second index, etc.
Well, without an SSCCE, I'm only guessing, but I can tell you that arrays are 0-based. That means that an array with 3 indexes will have index 0, 1, and 2. Index 3 is actually the 4th index.
Well, have you stepped through the program with a debugger, or simply added print statements, to figure out what exactly the code is doing?
What's your question? What have you tried? Where are you stuck? Please see the link in my signature on asking questions the smart way, as well as this article:...