Question: Use Java; Having a secure password is a very important practice when much of our information is stored online. Write a program that validates a
Use Java;
Having a secure password is a very important practice when much of our information is stored online. Write a program that validates a new password, following these rules:
The password must be at least characters long.
The password must have at least one uppercase and one lowercase letter
The password must have at least one digit.
The password must have at least one special character from the set @#$&:
Write a program that asks for a password. If the passwords dont match or the rules are not fulfilled, return false. Your program should include a method that checks whether a password is valid.
For full credit, you will need to implement the following methods:
public static boolean validLengthString pwd
public static boolean hasUpperCaseString pwd
public static boolean hasDigitString pwd
public static boolean hasSpecialCharString pwd
Tips:
I used nest loops for 'hasSpecialChar'. I just put all of the special chars together as String
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
