-1

Here is what I've done. I'm trying to have this triple conditioned while loop but it seems complete after only one of the conditions pass.

This is the console result:

Prasun
  • 4,943
  • 2
  • 21
  • 23

1 Answers1

1

Replace the && with || in your while loop.

It looks like you want to prompt the user until they enter a password that meets all of three criteria. That means you need to loop as long as they don't meet any of the criteria. This calls for OR logic instead of AND (since now you only loop as long as they don't meet all of the criteria).

Ben P.
  • 52,661
  • 6
  • 95
  • 123