Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have to use the given code to make a password verifier (java) /** * Chapter 8 * Programming Challenge 5: Password Verifier * The

I have to use the given code to make a password verifier (java)

image text in transcribedimage text in transcribed

/** * Chapter 8 * Programming Challenge 5: Password Verifier * The Passwordverifier class stores data about a user's password. */ public class PasswordVerifier { // Constant for minimum password length public static final int MIN_PASSWORD_LENGTH = 6; /** * isValid method */ public static boolean isValid(String str) { boolean status; // validity status if (str.length() >= MIN_PASSWORD_LENGTH && hasUpperCase(str) && hasLowerCase(str) && hasDigit(str)) status = true; else status = false; return status; } /** * hasUpperCase method */ private static boolean hasUpperCase(String str) { //insert code here } /** hasLowerCase method */ private static boolean hasLowerCase(String str) { //insert code here } /** * hasDigit method */ private static boolean hasDigit(String str) { //insert code here } } import java.util.Scanner; /** * Chapter 8 * Programming Challenge 5: Password Verifier * This program demonstrates the PasswordVerifier class. * */ public class PasswordDemo { public static void main(String[] args) { String input; // To hold input // Create a Scanner object for keyboard input. Scanner keyboard = new Scanner(System.in); 1/ Get a password. System.out.print("Enter a password: "); input = keyboard.nextLine(); // Check the password. if (!PasswordVerifier.isValid (input)) System.out.println("Invalid password."); else System.out.println("Valid password."); } }

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_2

Step: 3

blur-text-image_3

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions