Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/PasswordApp.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}
3 changes: 3 additions & 0 deletions src/passwords
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hello
hello123
hello123456