Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribed

image text in transcribed

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 valid

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions