Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using JAVA: Create a new class. . Use the main method from below. The main method may not be changed and will be used to
Using JAVA:
Create a new class. . Use the main method from below. The main method may not be changed and will be used to test the isValidPassword method that will be created public static void main(String] args) Scanner input new Scanner (System.in); boolean invalid true; // Get the password System.out.print ("Password: "); String password nput.nextLine(); // Check for validity if (isValidPassword (password)) System.out.println("Valid Password"); // password is good so make invalid false to stop loop invalid -false; else System.out.println("Invalid Password"; // Repeat until the password is valid ) while (invalid); input.close); // end method Create method isValidPassword o Declare method with appropriate - Identifiers - Type of return values " Formal parameters o Method isValidPassword checks if password meets the following criteria: * method isValidPassword checks if a password meets the *following criteria: *1) 8 characters *2) At least 2 digits 3) Consists only of letters and digits @param password The password to check *@return true or false depending if the password is validStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started