diff --git a/src/PasswordApp.java b/src/PasswordApp.java index 86fb0b1..a2d9453 100644 --- a/src/PasswordApp.java +++ b/src/PasswordApp.java @@ -1,5 +1,32 @@ +import java.util.Scanner; public class PasswordApp { public static void main(String[] args) { + Scanner scan = new Scanner(System.in); System.out.println("Welcome to the password checker!"); + + while(scan.hasNextLine()) { + String password = scan.nextLine(); //scans user input + + System.out.println("The password is: " + password); + + if(password.length() >= 12) { + System.out.println("Password met characterized length"); + }else { + System.out.println("Password has not met requirement(s)"); + } + + char[] characters = password.toCharArray(); + + boolean hasSpecial = false; //scans user input if it has numerical value + + for (int i=0; i< characters.length; i++) { + char character = characters[i]; + System.out.println(Character.isAlphabetic(character) == false); { + hasSpecial = true; + } + } + System.out.println("Has a special character" + hasSpecial); + } + } } -} \ No newline at end of file + diff --git a/src/passwords b/src/passwords new file mode 100644 index 0000000..9d8eadb --- /dev/null +++ b/src/passwords @@ -0,0 +1,3 @@ +hello +hello123 +hello123456 \ No newline at end of file