Question: Write a program that prompts the user for a password that contains at least two uppercase letters, at least two lowercase letters, and at least

Write a program that prompts the user for a password that contains at least two uppercase letters, at least two lowercase letters, and at least two digits. You can assume that the password entered by the user will not contain any whitespace. After the user enters a password, display a message indicating whether the user was successful or the reason the user was not successful. Save the file as ValidatePassword.java. Examples of program execution:

Enter your password, which must contain at least two uppercase letters, at least two lowercase letters, and at least two digits: Pw2 Your password (Pw2) is invalid because: - fewer than two uppercase letters - fewer than two lowercase letters - fewer than two digits Enter your password, which must contain and at least two uppercase letters, at least two lowercase letters, and at least two digits: Password1 Your password (Password1) is invalid because: - fewer than two uppercase letters - fewer than two digits Enter your password, which must contain at least two uppercase letters, at least two lowercase letters, and at least two digits: PassWord3 Your password (PassWord3) is invalid because: - fewer than two digits Enter your password, which must contain at least two uppercase letters, at least two lowercase letters, and at least two digits: P@55Word Your password (P@55Word) is valid.

 
 
 
 

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!