Question: Some programs impose certain rules for passwords. Write a program that asks the user to enter a password and report back to the user if

Some programs impose certain rules for passwords. Write a program that asks the user to enter a password and report back to the user if the entered password is valid password or not. If the password is valid, then the program will end. If the password is invalid, the program will indicate which of the 5 criteria was not met (see criteria listed below) and then ask the user to enter another password that is valid. The program will continue to ask for a password until a valid password is entered. Write a set of methods that checks whether the entered password string meets certain criteria for a valid password. A valid password meets the following 5 criteria:

1. A password must have at least 10 characters

2. A password must contain at least one upper case letter

3. A password must contain at least three lower case letters

4. A password must contain at least two digits

5. A password must contain at least one special character from the set {&, #, $, *, +, @, %}

Make sure your program implements the following methods:

public static Boolean atLeast10Characters(String password)

- Return true if password has at least 10 characters

public static Boolean atLeast1UpperCaseLetter(String password)

- Return true if password has at least 1 upper case letter

public static Boolean atLeast3LowerCaseLetters(String password)

- Return true if password has at least 3 lower case letters

public static Boolean atLeast2Digits(String password)

- Return true if password has at least 2 digits

public static Boolean atLeast1SpecialCharacter(String password)

- Return true if password has at least 1 special character

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!