Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design, implement and test a Java application that will validate passwords. For this project, a valid password is defined as 1. 6 or more characters

Design, implement and test a Java application that will validate passwords. For this project, a valid password is defined as 1. 6 or more characters (long). Each password must include - a. 1+ (one or more) numeric character b. 1+ uppercase alphabetic character c. 1+ lowercase alphabetic character d. 1+ special character e. At most (no more than) 2 of the same character together in a sequence f. Cannot start with a numeric value 2. Strong password if it has 10 or more characters 3. Weak password if its length is between 6 and 9 characters, however, a weak password is a valid password Here are some password examples Hello1@23 Valid password AAAbb@123 NOT valid Aaabbaa@123 Valid (a and A are NOT the same character) 123Hello@ - invalid (starting with a numeric value) Academic Honesty Policy Do your own work! Each project submission will be compared against other submissions from current and previous semesters. Good Faith Attempt (GFA) Requirement Your submission must successfully pass all of the provided (public) Junit test cases. In general, they are the xyz_test.java and xyz_GFA_test.java files (where xyz is the project name). For Project 1 PasswordChecker_GFA_Test.java PasswordCheckerTestPublic.java Others (if I have overlooked them) Include your test cases as specified in the PasswordCheckerTest_STUDENT.java Capture screenshots of your successful JUnit runs in your write-up INCLUDE your name as the author on every Java file that you are creating Expectations When the application begins, the user will be presented with a screen that states the above instructions for creating a password, two text entry boxes for typing in a password, and three buttons. (See provided sample runs) If the user wants to check a single password, they will type in the password in both boxes and select the Check Password button If the user wants to read in and check a list of passwords, they will select the Check Passwords in File button, be presented with a file explorer, and select the file to read from. Those passwords that failed the check will be displayed, with their error message. Specifications Data Element String Data Structure ArrayList of Strings Requirements Implement a PasswordCheckerUtility class as specified (See provided Javadoc) Name each method exactly as specified in the Javadoc. Otherwise, your code will fail a set of JUnit test cases Create an exception class for each of the exceptions listed (see Javadoc) Always check for the length of a password first (it is the easiest and fastest check) STOP as soon as a password fails one rule, there is no need to check for the remaining rules You will need to implement a good number of the methods as follow - return a value under normal processing; otherwise, throw an exception Here is an example - /** * Checks the password Digit requirement - Password must contain a numeric character * @param password - password string to be checked for Digit requirement * @return true if meet Digit requirement * @throws NoDigitException thrown if does not meet Digit requirement */ public static boolean hasDigit(String password) throws NoDigitException { // your logic } As the method is being called with a password as its argument, the method will return True // because the password has a digit in it throw NoDigitException // otherwise Do this for all methods with the same signature To check for a special symbol, use the following regular expression construct if you like. Check the whole password, and not just an individual character: Pattern pattern = Pattern.compile("[a-zA-Z0-9]*"); Matcher matcher = pattern.matcher(str); return (!matcher.matches());

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions