Quote:
Originally Posted by Pete Zicato
No. Step through the code and ask yourself what would happen if the password were too short and had no digit.
|
I should explain, the condition of the while loop would be written as:
Quote:
while ((!passLength(password)) || (!containDigit(password)))
|
...so it actually calls both functions, and should execute the loop if either one (or both) is false.
Once inside the loop, it should keep prompting and re-executing the loop until "false OR false" is false.
...
If I step through using "abc" as the input (too short and has no digit), it would say too short and get a new password. Then evaluate for digits. Then evaluate the loop again. Right?