Concepts tested by this program:
ArrayList
Tooltips
Mnemonic
Read Files
Javadoc
JUnit Tests
Exceptions
Create an application that will check for valid passwords. The following rules must be followed to create a valid password.
- At least 6 characters long
- 10 or more characters is a strong password, between 6 and 9 characters is a weak (but acceptable) password.
- At least 1 numeric character
- At least 1 uppercase alphabetic character
- At least 1 lowercase alphabetic character
- No more than 2 of the same character in a sequence
Hello123 OK
AAAbb123 not OK
Aaabb123 OK
Operation:
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.
Specifications:
The Data Element
String
The Data Structure
ArrayList of Strings
Utility Class
Create a PasswordCheckerUtility class based on the Javadoc given you. The PasswordCheckerUtility class will have at least three methods: One method will check the validity of one password and return true if the password is valid and throw an exception if invalid.
One method will check for a weak password, i.e., one whose length is between 6 and 9, inclusive. Do NOT throw an exception.
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>
Create exception classes for each exception listed in PasswordCheckerUtility Javadoc.
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
- 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-type the 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 PasswordCheckerUtility to process the passwords.
- Use try/catch structure to catch exceptions thrown by PasswordCheckerUtility methods
Exceptions
Provide exception classes for the following:
- Length of password is less than 6 characters (class LengthException)
Message The password must be at least 6 characters long
- Password doesnt contain an uppercase alpha character (class NoUpperAlphaException)
Message The password must contain at least one uppercase alphabetic character
- Password doesnt contain a lowercase alpha character (class NoLowerAlphaException)
Message The password must contain at least one lowercase alphabetic character
- Password doesnt contain a numeric character (class NoDigitException)
Message The password must contain at least one digit
- 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.
- 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.
If more than one error is present in a password, use the above order to throw exceptions. For example, if a password is xxyyzzwwaa, it fails rules 2 and 4 above. Throw a NoUpperAlphaException, not a NoDigitException.
- The file will be in the following format (one password per line):
Examples:
- No lowercase alphabetic character
Displayed to user:
- No digit
Displayed to user:
- If the password is OK, but between 6 and 10 characters, you will see:
- If password has more than two of the same characters in a row
Displayed to user:
- If password is valid
Displayed to user:
- If the passwords do not match:
Displayed to user:
- Based on the file above, when the user selects Check Passwords in File:
Displays errors to user when selecting Check Passwords in File. Note that valid passwords are NOT displayed.
Deliverables:
Design:
Initial design document (UML and pseudo-code)
Implementation:
Final design document INCLUDE JAVAFX
Java files The src folder with your driver (javafx application), data manager, exceptions and Junit Test (.java) files
Javadoc files The entire doc folder with your javadoc for student generated files
Learning Experience document
single line comments
package declaration
GENERICS LAB
STUDY GUIDES?
Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats:
LastNameFirstName_AssignmentX.zip [compressed file containing following]:
doc [a directory] include the entire doc folder with the javadoc for
student generated files
file1.html (example)
file2.html (example)
class-use (example directory)
LearningExperience.doc or other text format
src [a directory] contains your driver (javafx application), data manager, exceptions and Junit Test (.java) files
File1.java (example)
File2.java (example)
File_Test.java (example)
LastNameFirstName_AssignmentX_Moss.zip [compressed file containing only]:
.java file which includes the driver (javafx application), data manager, exceptions and Junit Test (.java) files NO
FOLDERS!!
File1.java (example)
File2.java (example)
Grading Rubric
CMSC 204 Project #1
Name _____________________________
Overview:
There are two parts to the rubric. First, the project is graded on whether it passes public and private tests. If it does not compile, a 0 will be given. These points add up to 100. Second, the score is decremented if various requirements are not met, e.g., no Javadoc, no UML diagram, uses constructs that are not allowed, etc.
TESTING (100 pts)
Passes Public JUnit tests without runtime exceptions thrown on console 20 pts _____
Passes JUnit student tests 5 pts _____
Passes private instructor tests 75 pts _____
Possible Sub-total 100 pts _____
REQUIREMENTS (Subtracts from Testing total)
Documentation:
Javadoc for student generated files not submitted (entire doc folder) -6 pts _____
Documentation within source code was missing or incorrect -6 pts _____
Description of what class does was missing
Authors Name, @author, was missing
Methods not commented properly using Javadoc @param, @return
JUnit STUDENT methods were not implemented -6 pts _____
Learning Experience -4 pts _____
In 3+ paragraphs, highlight your lessons learned and learning experience from working on this project. What have you learned? What did you struggle with? What would you do differently on your next project?
Programming Style:
Incorrect use of indentation, statements, structures -8 pts _____
User Interface -6 pts _____
Not clear to user how data is to be entered; UI does not follow requirements
Output is not easy to understand
Design:
Classes do not have the functionality specified, i.e.,
- PasswordCheckerUtility class -8 pts _____
does not have a method to check validity of password
does not have a method to check validity of ArrayList of passwords
does not follow the Javadoc provided
- GUI -8 pts _____
does not use methods of PasswordCheckerUtility
does not display status of password entered by user
buttons do not have tooltips and mnemonics
- Exceptions classes -8 pts _____
does not have exception class for each invalid password rule
does not have exception class if password and re-type password dont match
Possible decrements: -60 pts _____
Possible total grade: 100 pts _____
Reviews
There are no reviews yet.