CMSC204
Assignment 1
Passwords
Concepts tested by this program:
ArrayList
static
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.
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.
At least 1 special character
7.
No more than 2 of the same character in a sequence
[email protected] – OK
[email protected] – not OK
[email protected] – OK
Special Characters:
Special characters are a selection of punctuation characters that are present on standard
US keyboard and frequently used in passwords.
Characte
r
Name
Space
!
Exclamation
”
Double quote

Characte
r
Name
#
Number sign (hash)
$
Dollar sign
%
Percent
&
Ampersand
’
Single quote
(
Left parenthesis
)
Right parenthesis
*
Asterisk
+
Plus
,
Comma
-
Minus
.
Full stop
/
Slash
:
Colon
;
Semicolon

Characte
r
Name
<
Less than
=
Equal sign
>
Greater than
?
Question mark
@
At sign
[
Left bracket
\
Backslash
]
Right bracket
^
Caret
_
Underscore
`
Grave accent (backtick)
{
Left brace
|
Vertical bar
}
Right brace
~
Tilde

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.
Specifications
:
The Data Element
String
The Data Structure
ArrayList of Strings
Utility Class
1.
Create a PasswordCheckerUtility class based on the Javadoc given you.
2.
The PasswordCheckerUtility class will have at least three public methods:
isValidPassword:
This method will check the validity of one password and return true if the
password is valid and throw one or more exceptions if invalid.
isWeakPassword:
This method will che throw an exception.
getInvalidPasswords
This method will check an ArrayList of passwords and return an ArrayList with
the status of any invalid passwords (weak passwords are not considered invalid).
