Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do not use arrays. Design and implement a Java program (name it Password). In the program, design a method (name it CheckPassword) that takes a

Do not use arrays. Design and implement a Java program (name it Password). In the program, design a method (name it CheckPassword) that takes a password as a parameter, determines whether the password is valid or invalid using the following rules. Then it returns the outcome as boolean value (true or false).

The rules are:

- Password must include at least 10 characters - Password contains only letters and digits - Password must include at least 3 digits

Use three additional boolean methods, one for each stated rule above, to check if that rule is met or not. A boolean method returns a boolean value. A password is valid if all three rule methods return true values, otherwise the password is invalid. Design the program main method such that it allows the user to re-run the program with different inputs (as we did in the previous assignment using a sentinel loop structure). Document your code and organize the outputs properly using escape characters. In the main method, ask the user to enter a password and then display the judgement Valid Password or Invalid Password. Sample runs are:

Enter a password: CS5000/01 Entered password: CS5000/01 Judgment: Invalid Password

Enter a password: CS5000 Entered password: CS5000 Judgment: Invalid Password

Enter a password: CS5000Section01 Entered password: CS5000Section01 Judgment: Valid Password

Enter a password: MyOldK9Dog Entered password: MyOldK9Dog Judgment: Invalid 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

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

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions