public class HelloWorld{ public static boolean lengthCheck(String input) { if (input.length() >= 6 && input.length() < 11){ return true; } return false; } public static boolean symbolCheck(String input){ if (input.matches("[a-zA-Z0-9]*")) { return true; } return false; } public static boolean digitCheck(String input){ input = input.replaceAll("[^0-9]",""); if (input.length() >= 2){ return true; } return false; } public static void testPassword(String input){ boolean secure = false; if (lengthCheck(input)) { secure = true; } else { System.out.println("Password must be between 6 and 10 characters"); secure = false; } if (symbolCheck(input)) { secure = true; } else { System.out.println("Password must consist only of letters and digits"); secure = false; } if (digitCheck(input)) { secure = true; } else { System.out.println("Password must have at least 2 digits"); secure = false; } if (secure == true) System.out.println("Password is valid"); return; } public static void main(String []args){ String testPass = "Pa$s$s"; testPassword(testPass); } }