Question: Write the program in java and comment what each line of code does please Problem 4: Write a program that allows users to choose a

Write the program in java and comment what each line of code does please

Problem 4: Write a program that allows users to choose a new password that matches some rules. The passwords should be at least seven characters long, have an uppercase letter, a lowercase letter, and a digit. The program will ask the user for their password twice. If the passwords entered are different or are invalid, the program will repeat the process until a valid password is chosen.As part of this program, write a method boolean isPasswordValid(String password) which implements the validation logic described above to check if a single password is valid. Example: Choose a new password. It should be at least eight characters long, have both an uppercase and lowercase letter, and have a digit. Enter your new password: hunter2 Enter your new password again: hunter2 Password is invalid, please try again. Enter your new password: Hunter2 Enter your new password again: hunter2 Password is invalid, please try again. Enter your new password: Hunter2 Enter your new password again: Hunter2 Your password is set. Thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!