passwords must be at least 6 characters long, and they must use at least 3 of the following 4 types of characters: upper case letters (e.g., A, B, C, ...) lower case letter (e.g., a, b, c, ...) digits...

passwords must be at least 6 characters long, and they must use at least 3 of the following 4 types of characters: upper case letters (e.g., A, B, C, ...) lower case letter (e.g., a, b, c, ...) digits (e.g., 1, 2, 3, ...) special characters (e.g., !, @, $, %, ...) you will implement a program that checks whether a string entered by the user meets several criteria to qualify as a valid password. Create a new Eclipse project by copying ProjectTemplate. Name the new project PasswordChecker. Open the src folder of this project and then open (default package). As a starting point you should use ProgramWithIOAndStaticMethod.java. Rename it CheckPassword and delete the other files from the project. Edit CheckPassword.java (including updating comments appropriately) to ask the user for a string (a password candidate ), input it, and let the user know whether it satisfies certain criteria, and if not, which one(s) it fails to satisfy. You will do this in stages. In this first step, only check that the string satisfies the length requirement . In the next few steps, you will add other checks. Test your program after adding each new check to increase your confidence that the program is working. The checking should be done in a static method declared as follows: 1 2 3 4 5 6 7 8 9 10 11 /** * Checks whether the given String satisfies the CSE department criteria for * a valid password. Prints an appropriate message to the given output * stream. * * @param s * the String to check * @param out * the output stream */ private static void checkPassword(String s, SimpleWriter out) {...} Now add a check to checkPassword that the string also contains an upper case letter. For this check you should implement and use another static method declared as follows: 1 2 3 4 5 6 7 8 /** * Checks if the given String contains an upper case letter. * * @param s * the String to check * @return true if s contains an upper case letter, false otherwise */ private static boolean containsUpperCaseLetter(String s) {...} In a similar fashion, add checks to checkPassword that the string contains a lower case letter and that it contains a digit. Declare and use appropriate static methods following the example of containsUpperCaseLetter. The boolean static methods Character.isLowerCase(char) andCharacter.isDigit(char) can simplify this task. Also modify checkPassword so that it rejects a password if it does not contain characters from at least two of the three types checked so far (upper case letters, lower case letters, and digits). Complete the password checker by adding the check for special characters (use a new static method like the ones for the other checks) and rejecting passwords that do not contain characters from at least three of the four types. For this step assume a valid special character is one in the string "!@#$%^&*()_-+={}[]:;,.?". Modify the main program so that it repeatedly asks the user for a new password, checks it and prints a message. The program should exit when the user enters an empty string (i.e., the user just presses the Enter key without entering any other characters). LINK: https://www.dropbox.com/s/1wf1u4ir2qcjj2g/Lab_%20Password%20Checker.html?dl=0 SRC LINK: https://www.dropbox.com/s/3f9wibi0ne4t8op/CheckPassword.zip?dl=0
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here