218k views
3 votes
You will be writing a password validator. The user will input a password and the program must check that it has: At least 8 characters At least two uppercase letters At least one lowercase letter At least two numbers If the value is invalid, print "Invalid password, try again" and accept another input. Otherwise, print "Password accepted" and end the program.

User Jommy
by
5.1k points

2 Answers

4 votes

Final answer:

The question involves creating a password validator that checks for a minimum length of 8 characters, two uppercase letters, one lowercase letter, and two numbers. If the criteria aren't met, the program should ask for a new password until a valid one is submitted, at which point it will display 'Password accepted'.

Step-by-step explanation:

The question at hand involves writing a password validator program which checks for certain criteria in a user's password input. To accomplish this task, the program should verify that the submitted password meets the following conditions:

  • Contains at least 8 characters
  • Includes at least two uppercase letters
  • Has at least one lowercase letter
  • Features at least two numbers

If a password does not meet these requirements, the program should output "Invalid password, try again" and prompt for another input. Once a password satisfies all the criteria, it should display "Password accepted" and terminate.

User Bram
by
6.0k points
4 votes

Answer:

Ca$h_AlL_d23ay

Step-by-step explanation:

Hope this is valid. lol

User Dixkin
by
5.3k points