CMSC204 Assignment 1 solved

Original price was: $35.00.Current price is: $35.00. $21.00

Category: You will receive a download link of the .ZIP file upon Payment


5/5 - (1 vote)

Concepts tested by this program:




Read  Files


JUnit Tests



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


  1. At least 8 characters long
  2. At least 1 numeric character
  3. At least 1 uppercase alphabetic character
  4. At least 1 lowercase alphabetic character
  5. No more than 2 of the same character in a sequence

Hello123 – OK

AAAbb123 – not OK

Aaabb123 – OK



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.

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



The Data Element


The Data Structure

ArrayList of Strings

The Data Manager

Create a PasswordChecker class that implements PasswordCheckerInterface.  The PasswordChecker class will have at least two methods:  One method that checks the validity of one password that returns true if the password is valid and that throws an exceptionif invalid.One that checks an ArrayList of passwords and returns an ArrayList with the status of any invalid passwords.  The ArrayList of invalid passwords will be of the following format:

<password><space><message of exception thrown>

Create exception classes for each exception listed in

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.


  • Provide buttons to allow user to check validity of one password or a file of passwords.
  • Ask the user to enter the password and to re-typethe password. If the two are not the same, inform the user.
  • Create a tool tip and a mnemonic for each of the buttons.
  • Use a FileChooser for the user to select the input file.
  • Use methods of PasswordChecker to process the passwords.
  • Use try/catch structure to catch exceptions thrown by PasswordChecker methods


Provide exception classes for the following:

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

Message – The password must be at least 8 characters long

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

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

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

Message – Error

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

Message – The password must contain at least one digit

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

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

Message – The passwords do not match




  • The file will be in the following format:

One password per line




  1. Note: If you check for the uppercase before the lowercase – you will receive the uppercase exception

Displayed to user:


  1. Note: If you check for the uppercase before the digit – you will receive the uppercase exception

Displayed to user:



Displayed to user:



Displayed to user:



Displayed to user:


6.Based on the file above:


Displayed to user when selects Check Passwords in File




Assignment 1 Grade Sheet – Spring 2016


Name   ____________________________


DOCUMENTATION                                                                         20 points

CheckList for Assignment 1 is included and completed                      1 pt   _____

Class documentation – Javadoc for all user created classes                  3 pt   _____

Class Description, @author

Method description, @param, @return

Test Cases                                                                                       8 pt  _____

JUnit Test Class

Implement STUDENT test in

PasswordCheckerTest given you

UML Diagram                                                                                      3 pt  _____

Lessons Learned                                                                                  5  pt _____

In 3+ paragraphs, highlight your lessons learned and learning experience from working on this project.  How did you do?  What have you learned?  What did you struggle with? How will you approach your next project differently?

PROGRAMMING                                                                             80 points

Internal class documentation (within source code)             16 pts   _____

Class description using Javadoc

Author’s Name, Class, Class Time, @author

Methods commented using Javadoc, @param, @return

Additional comments as needed

Program user interface                                                                    6pts      _____

Clear to user how data is to be entered

Output is easy to understand


Received correct output

  1. Public tests (given to you)             6pt    _____
  2. Your test written for PassworkCheckerTest 6 pt   _____
  3. Private tests 10pt  _____


Program Detail

  1. PasswordChecker class 12pts    _____
    1. Method to check validity of password
    2. Method to check validity of ArrayListof passwords
    3. Implements PasswordCheckerInterface
  2. GUI classes 12pts    _____
    1. Uses methods of PasswordChecker
    2. Displays status of password entered by user
    3. Buttons have tooltips and mnemonics
    4. Reads from a file and displays illegal passwords
    5. Stores contents of file in ArrayList
    6. check if user entered password and

Retyped are not the same

  1. Exceptions classes                                                                        12pts    _____
    1. Class for each invalid password rule
    2. Class if password and re-type passworddon’t match


Total                                                                                                    100 pts   _____