Answered You can buy a ready-made answer or pick a professional tutor to order an original one.

QUESTION

Create a project with 2 Java class files. Create two new Java files and save as PasswordVerifier.java & PasswordDemo.java and add them to your project. o PasswordVerifier will contain class (of static

Create a project with 2 Java class files. 

Create two new Java files and save as PasswordVerifier.java & PasswordDemo.java and add them to your project. 

o PasswordVerifier will contain class (of static) methods to check conditions required for a valid password 

o PasswordDemo.java will contain a main method with console I/O to prompt a user for a password via I/O method

Systematically, add and unit test the above/following six static methods to your PasswordVerifier class 

1. Create the empty class PasswordVerifier with one static field: MINIMUM_PASSWORD_LENGTH. 

2. Fix your indentation and get each method to compile before moving on to the next step . 

public class PasswordVerifier { // Constant for minimum password length private static int MINIMUM_PASSWORD_LENGTH = 6; } 

A. isMinimumLength: Add a static boolean method that returns true if the string argument passed into the method contains at least the minimum number of characters; false otherwise Unit test your method 

B. hasUpperCase: Add a static boolean method that returns true if the string argument passed into the method contains at least one uppercase letter; false otherwise Unit test your method LAB 3 

C. hasLowerCase: Add a static boolean method that returns true if the string argument passed into the method contains at least one lower letter; false otherwise Unit test your method 

D. hasDigit: Add a static boolean method that returns true if the string argument passed into the method contains at least one digit; false otherwise Unit test your method 

E. hasLegalChars: Add a static boolean method that returns true if the string argument passed into the method contains no characters other than only letters (A..Z, a..z), digits (0..9), and the underscore character ('_'); false otherwise Unit test your method LAB 3 

F. isValid: Add a static boolean method that returns true if the string argument passed into the method has at least the minimum number of characters, has at least one uppercase, one lowercase, one digit, and has only legal characters; false otherwise Hint: Use your existing class methods, do not rewrite their logic. Unit test your method 

Write a main method that uses your static class methods 

Add a main method to your PasswordDemo class that 

1. Prompts for and reads in a user password 

2. Calls the isValid static method in PasswordVerifier to validate the password 

3. Displays whether the password is valid or not 

Show more
  • @
  • 22 orders completed
ANSWER

Tutor has posted answer for $10.00. See answer's preview

$10.00

******** ******** Class ******* ***** **************** { ******* ****** final *** *********************** = ** public ****** ******* ********************** ********* * ** ********* ** ***** { ****** ****** * ****** ***************** >= ************************* } public ****** boolean hasUpperCase(String password) * for ***** ** * passwordtoCharArray()) * if *** >= *** ********** ch ***** **** { ****** ***** * * return ****** } ****** ****** ******* hasLowerCase(String ********* { for (char ** * passwordtoCharArray()) * ** *** ***** *** && ** ***** 'z') * return ***** * } return false; * ****** ****** ******* *************** password) * *** ***** ch * passwordtoCharArray()) { ** *** ***** *** ********** ** <= **** { ****** ***** * * ****** ****** * ****** static ******* ******************** ********* * *** ***** ** * ********************** * if ****** >= '0' ********** ch ***** **** || *** ***** *** ********** ** ***** **** ** (ch ***** 'A' ********** ch ***** 'Z') ** ** ** ***** * ****** ****** * * ****** ***** } public static boolean ************** ********* { return ************************* ********** hasLegalChars(password) && ********************** ********** hasLowerCase(password) ********** hasDigit(password); ********** ******** ********** ********************** ***** PasswordDemo { ****** ****** **** ************* ***** * ******* ** = new Scanner(Systemin); ******* ****** * ****** ** * Systemoutprintln("Enter * ******** * *** ****** password * ************* ************************************** ****** * ***** Systemoutprintln("Valid *********** }else{ Systemoutprintln("Invalid password\n"); * * while ********** **

Click here to download attached files: PasswordDemo.txt
Click here to download attached files: PasswordVerifier.txt
or Buy custom answer
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question