Strings with While Loops?

Home » Programming & Design » Strings with While Loops?
Programming & Design No Comments

I made a program that generates random passwords and concatenates them to a string using a couple while loops and then asks the user to continue. My terminating condition is a boolean statement that continues until the user requests to stop. My only problem is that the output keeps printing the first password

I made a program that generates random passwords and concatenates them to a string using a couple while loops and then asks the user to continue. My terminating condition is a boolean statement that continues until the user requests to stop. My only problem is that the output keeps printing the first password generated and not the current one. Any suggestions?

Other answer:

Abdullah:
Debugging is a critical skill for a programmer to learn – we all make mistakes. If you showed us your code, we could probably find the error just by looking at it. Or you could try to find it yourself.

If you have a good IDE, you can try stepping through your code line by line to see what the variables are as you run it. That might help indicate where the problem is.

If you don't have a good IDE, then instead you can add code to output the values of particular variables at various places in your code. This might let you know what is going on.

My wild guess is that you have a variable that should be reset back to 0, inside the outer loop but outside the inner loop, that you aren't resetting. Without seeing your code, of course, it's impossible to say.

Lauren:
Your code isn't repeating properly. Make sure there is something outside of the closing statement that tells it to run again.
heitan:
Your code isn't repeating properly. Make sure there is something outside of the closing statement that tells it to run again.
dan3141592653:
Your code isn't repeating properly. Make sure there is something outside of the closing statement that tells it to run again.
more:
What a useless program.
justme:
Not without seeing your code.
?:
What a useless program.

LEAVE A COMMENT