Originally Posted by
copeg
Step through the code either by hand with a pen and paper, or by adding some println statements as a debugging tool (or if your experience allows, use a debugger). What would be (or is if you use a debugger/println) the value of k for each iteration of the inner loop? I'm guessing once you do this, you will see a problem (hint: variable scope)
Seeing as how the program is supposed to be run as an applet, I do not know how I would use a print or println statement.
I am assuming that your nuanced reply is suggesting that the value of k is not changing, and I will have to take another look at it.
Thanks.
EDIT:
I found the error and pulled L and k out so that they are not reset each time the loop runs.