Question: Write a Java program (name it PasswordYourname). That takes a string password from user input, determines whether the password is valid or invalid using the
Write a Java program (name it PasswordYourname). That takes a string password from user input, determines whether the password is valid or invalid using the following rules.
The rules are:
- Password must include at least 9 characters
- Password contains only alphabet letters and digits (a to z, A to Z, 0 to 9)
- Password must include at least 3 digits
Hint 1: You may need a loop for retry.
Hint 2: You may need a loop for check each character of String
First test:
Enter a password: CS5000/01 //User input
Entered password: CS5000/01
Judgment: Invalid Password
Retry? (Y/N): Y //User input
Second test:
Enter a password: CS5000Section01
Entered password: CS5000Section01
Judgment: Valid Password
Retry? (Y/N): Y
Third test:
Enter a password: MyOldK9Dog
Entered password: MyOldK9Dog
Judgment: Invalid Password
Retry? (Y/N): N
Program Terminated
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
