Starting from:

$25

CMSC204 Project 1A | Password Checker Solved

Create a Java application that will check for valid passwords.  The following rules must be followed to create a valid password.

 

1.     At least 6 characters (long)

2.     10 or more characters is a strong password, between 6 and 9 characters is a weak (but acceptable) password

3.     At least 1 numeric character

4.     At least 1 uppercase alphabetic character

5.     At least 1 lowercase alphabetic character

6.     No more than 2 of the same character in a sequence

Hello123 – OK

AAAbb123 – not OK

Aaabb123 – OK

 

Academic Honesty Policy Reminder | Do your own work – each submitted project will be compared against other submissions from current and previous semesters.

 

Requirements

·      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.

·      If the user presses the “Alt” key, a letter will be underlined in each button label.  That letter is the “mnemonic” that can use as a shortcut (Alt plus the letter) to execute the button.

·      If the user hovers his cursor over a button, a tooltip will be shown.

 

Specifications

Data Element

·      String

 

Data Structure

·       ArrayList of Strings

 

Classes - Utility & Others

·       Create a PasswordCheckerUtility class based on the Javadoc given you.  The PasswordCheckerUtility class will have at least three methods: 

o   One method will check the validity of one password and return true if the password is valid and throw an exception if invalid. 

o   One method will check for a “weak password”, i.e., one whose length is between 6 and 9, inclusive. Do NOT throw an exception. 

o   One method will check an ArrayList of passwords and return an ArrayList with the status of any invalid passwords (weak passwords are not considered invalid).  The ArrayList of invalid passwords will be of the following format:

§  <password<space<message of exception thrown

·       The methods will have the following headers:

o   static boolean isValidPassword(String pwdString);

o   static boolean isWeakPassword(String pwdString);

o   static ArrayList<String invalidPasswords(ArrayList<String passwords);

·       Always check for the length of the password first, since that is the easiest and fastest check.  Once the password fails one rule, you do not need to check the rest of the rules.

 

The GUI (Provided)

·       Buttons are provided to allow user to check validity of one password or a file of passwords

·       The user may be asked to enter the password and to re-type the password.  If the two are not the same, the user is informed

·       A tool tip and a mnemonic are available for each of the buttons

·       A FileChooser asks the user to select the input file

·       Methods of PasswordCheckerUtility are used to process the passwords.

·       Try/catch structures catch exceptions thrown by PasswordCheckerUtility methods

·       Provided UI driver should work just fine, however, you are welcome to modify it or create your own.  With that said, your project must satisfy (successfully passed) all of the specified requirements

 

 

Exceptions

·       Create exception classes for each exception listed in PasswordCheckerUtility Javadoc and listed below:

1.     Length of password is less than 6 characters (class LengthException)

·       Message – The password must be at least 6 characters long

2.     Password doesn’t contain an uppercase alpha character (class NoUpperAlphaException)

·       Message – The password must contain at least one uppercase alphabetic character

3.     Password doesn’t contain a lowercase alpha character (class NoLowerAlphaException)

·       Message – The password must contain at least one lowercase alphabetic character

4.     Password doesn’t contain a numeric character (class NoDigitException)

·       Message – The password must contain at least one digit

5.     Password contains more than 2 of the same character in sequence (class InvalidSequenceException)

·       Message – The password cannot contain more than two of the same character in sequence.

6.     For GUI – check if Password and re-typed Password are identical (class UnmatchedException)

·       Message – The passwords do not match

·       Throw this exception from the GUI, not the utility class.

 

Programming Concepts

This project utilizes the following concepts:

·      ArrayList

·      Tooltips

·      Mnemonic

·      Read Files

·      Javadoc

·      JUnit Tests

·      Exceptions

·      GitHub

GitHub

·      As you are working on your project, utilize your GitHub repro (upload your project files to a directory named Project1_Passwords.  You will need to submit a screenshot of your repro during submission.

 

Testing

As a typical user, I should be able to utilize your program without running into too much difficulties!  Thoroughly test your project
·       Think about the public and private test cases which your instructor will test your project against

·       If there are more than one errors in a password, use the order (as specified in the UI) to throw exceptions.  For example, if a password is “xxyyzzwwaa”, it fails rules 2 and 4 above.  Throw a NoUpperAlphaException, not a NoDigitException



 

File Format

The file will be in the following format: One password per line

 



 

 


Write-up & Submission Requirements

Review the provided rubric to understand project expectations, including documentation, CMSC204, and programming requirements.   Two artifacts MUST be submitted for this project: Java source code and a write-up. 

At a minimum, the write-up needs to address - 

Approach, design & algorithm
DO NOT start coding your project immediately!  Come up with a high level design for the project first
What’s your game plan to complete the project?
Break the project into smallest modules where applicable
UML diagrams will go a long way
Each student is welcome to expand on the design, if it makes sense.  Students will not be penalized for going “above and beyond” specifications of the project
Complete this step first, then write your code
Test Plan & Test Cases
Ensure that your project can successfully pass all provided “public test cases.”  What other test cases have you attempted?
Students should think about potential private tests – what would they be?
Your instructor will test your project using an additional set of private test cases as well as the provided public test cases
o   I want to see your “thinking,” in particular, how you are testing your program

o   Each submission should be rock solid, with no bugs

Capture screenshots of your test runs in your write-up as you run them
Highlight your learning experience and lessons learned
I am very interested to learn about what you have done, how you did, etc.
Anything else that you want to share with me
·      Take a screen shot of the repo with the directory and files.

For Project 1, see provided sample write-up
 

Each student must submit one compressed (.zip) file back to the Assignment (link) with the following deliverables:

Your entire Eclipse project folder (Source code included)
Write-up as a Word or PDF file, one write-up per project
·       I WILL compile, run and test every submission using a set of public and private test cases – this is how I test to ensure that your project is working correctly

·       Name the compressed file (zip format) as  <lastname_project_x 

where x is the project number and your last name (e.g. Thai_Project_1.zip)
Double check your submission, as I can only grade what’s being submitted (don’t assume anything)
DO NOT email your submission!  It won’t be accepted
 

Not clear?  That’s okay, but do ask your questions.  “I did not know” or “I did not understand” is not good enough.

 

Start working on each project immediately so that we can discuss any concerns or questions you have.  Reminder – I am unavailable on Saturdays and have limited availability on Sundays.

 


Sample Test Cases & Outputs (from Previous Semester)

 

At startup

 



 


 

1.     No lowercase alphabetic character

 



 

Displayed to the user:



 


 

2.     No digit

 



 

 

Displayed to user:



 


 

3.     If the password is OK, but between 6 and 10 characters, you will see:



 

 

 

4.     If password has more than two of the same characters in a row



 

Displayed to user:



 


 

5.     If password is valid



 

Displayed to user:



 


 

 

6.     If the passwords do not match:



 

Displayed to user:




 

7.     Using a password file, when the user selects “Check Passwords in File”:

8.      

Displays errors to user when selecting Check Passwords in File. Note that valid passwords are NOT displayed.



 

More products