Question: Write a java program that prompts the user to create a new password with at least one uppercase letter, one lowercase letter, and one digit.
Write a java program that prompts the user to create a new password with at least one uppercase letter, one lowercase letter, and one digit. The password must have a length of 5. If the password violates on of these rules, tell the user which error has occurred. If the password is good, display a message that the password has been changed.
Sample run:
Enter your new password: xnyp8 Your password should contain one uppercase letter.
Enter your new password: treaT Your password should contain one digit.
Enter your new password: mX4dt Your password has been changed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
