Question: /** * Project 4 Comprehensive password tester * @author gcohen */ public class PasswordTester1 { public static void main(String[] args) { String[] passwords = {

![public class PasswordTester1 { public static void main(String[] args) { String[] passwords](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5250925fae_83266f52508818f4.jpg)



/** * Project 4 Comprehensive password tester * @author gcohen */ public class PasswordTester1 {
public static void main(String[] args) { String[] passwords = { "abcd", // Wrong size "abcd_defg", // Has non-recognized special character "abcdefgh", // All one case "Abcdefgh1", // Needs a second digit "Abcdefgh12", // Missing a special character "Abcdefgh%12" // Valid };
// Check the individual methods first boolean status; String password = passwords[0]; status = CheckPassword.hasValidSize(password); checkResult(password, !status, "Password wrong size test"); password = "abcdefghijk"; status = CheckPassword.hasValidSize(password); checkResult(password, status, "Password size ok test"); password = passwords[1]; status = CheckPassword.hasValidCharacters(password); checkResult(password, !status, "Has invalid character test"); password = passwords[5]; status = CheckPassword.hasValidCharacters(password); checkResult(password, status, "Has valid character test"); password = passwords[2]; status = CheckPassword.hasUpperLowerCase(password); checkResult(password, !status, "All Upper/Lower case test"); password = passwords[5]; status = CheckPassword.hasUpperLowerCase(password); checkResult(password, status, "Mixed Upper/Lower case test"); password = passwords[3]; status = CheckPassword.hasTwoDigits(password); checkResult(password, !status, "No 2+ digit test"); password = passwords[5]; status = CheckPassword.hasTwoDigits(password); checkResult(password, status, "Has 2+ digit test"); password = passwords[4]; status = CheckPassword.hasSpecialCharacters(password); checkResult(password, !status, "No Special Characters test"); password = passwords[5]; status = CheckPassword.hasSpecialCharacters(password); checkResult(password, status, "Has Special Characters test");
// Codes should be 1 greater than index, except for the last one for (int i = 0; i
}
public static void checkResult(String password, boolean status, String testMessage) { if (status) { System.out.printf("PASSED - %15s %s ", password, testMessage); } else { System.out.printf("FAILED - %15s %s ", password, testMessage); } } }
this is the "improved tester he gave us.![individual methods first boolean status; String password = passwords[0]; status = CheckPassword.hasValidSize(password);](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5250c89b66_83566f5250bdc2aa.jpg)

![checkResult(password, status, "Password size ok test"); password = passwords[1]; status = CheckPassword.hasValidCharacters(password);](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5250e637d0_83766f5250ddabe5.jpg)
In java please
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
