Question: Write a Java program, named Password. In the program, design and implement a method ( named CheckPassword ) that takes a string password as a
Write a Java program, named Password. In the program, design and implement a
method named CheckPassword that takes a string password as a parameter, determines whether the
password is valid or invalid using the following rules. The method then returns the outcome as a boolean
value true or false
The rules are:
Password must include at least characters
Password contains only letters and digits
Password must include at least digits
Password must include at least lowercase letters
Password must include at least uppercase letters
Develop five additional boolean methods, one for each stated rule above, to check if that rule is met or not. A
password is valid if all five methods return true values, otherwise the password is invalid. Design the
programs main method such that it allows the user to rerun 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 test data below show both input prompts and
output labels. Make sure your code displays the outputs following the test data format.
First test: Enter a password: CS
Entered password: CS
Judgment: Invalid Password
Second test: Enter a password: CSSection
Entered password: CSSection
Judgment: Valid Password
Third test: Enter a password: MyOldKDog
Entered password: MyOldKDog
Judgment: Invalid Password
Fourth test: Enter a password: ABCabc
Entered password: ABCabc
Judgment: Valid Password
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
