Question: Java program that does the following things: - It should ask the user to type in their password, and read in what the user typed.
Java program that does the following things:
- It should ask the user to type in their password, and read in what the user typed. - It should then ask the user to retype their password, read in what they typed, and ensure it matches the first thing that was typed. If it does not match, the program should tell the user the passwords do not match, and end without telling them any additional information. - If the passwords match, we should check for the following things. If any of them are not true of our password, we should inform the user of the mistake. Since the user may make multiple mistakes, we do want to inform them of each mistake they may make, so all printouts should occur. - Is there at least one capital letter? (A hint to a speedy way to do this: If there isn't one, an entirely lowercase version of the password should be identical). - Is there at least one number? - Is the password at least eight characters long? - Is there one of the following punctuation marks? ? ! * # $ @ % & ^
If the password meets all the criteria, we should print "Your password is valid!"
Example Outputs:
Enter a Password: Abc$ Reenter Password: Abc$ * Invalid, password must have at least one number * Invalid, password must be at least eight characters long
Enter a Password: IntroProgram2! Reenter Password: IntroProgram2! Your password is valid!
Enter a Password: abc Reenter Password: abcd Passwords entered do not match.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
