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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started