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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!