public class CheckPassword
extends java.lang.Object
The provided code is incomplete. Modify it so that it works properly and passes the tests in
CheckPasswordTest.java
.
Constructor | Description |
---|---|
CheckPassword() |
Modifier and Type | Method | Description |
---|---|---|
static boolean |
checkPassword(java.lang.String password,
int minLength,
int minLetter,
int minNumber,
int minSpecial) |
Given a potential password check it against provided rules.
|
static void |
main(java.lang.String[] unused) |
Solicits two strings from the user and print if they are anagrams.
|
public static boolean checkPassword(java.lang.String password, int minLength, int minLetter, int minNumber, int minSpecial)
The function is passed a length and letter, number, and special character counts. It should return true if the password is the appropriate length and has the required number of letters, numbers, and special characters, and false otherwise. !,@,#,$,%,^,& (ampersand), and * count as special characters.
The counts may be zero, in which case there are no requirements for that rule. For example, if numberCount == 0 then the password does not have to contain a number. Of course, it still can.
The passed password string may be empty but will not be null.
password
- the password to checkminLength
- the minimum length for the passwordminLetter
- the minimum number of letters the password must containminNumber
- the minimum number of letters that the password must containminSpecial
- the minimum number of special characters that the password must containpublic static void main(java.lang.String[] unused)
You are free to review this function, but should not modify it. Note that this function is not tested by the test suite, as it is purely to aid your own interactive testing.
unused
- unused input arguments