Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write a Java application program that can check a password to see whether it s secure. This program is like a password game. If
Please write a Java application program that can check a password to see whether it s secure. This program is like a password game. If the password is not secure, your program must report all the security violations Please see the following test case #1 to design your application program. Please stop your program when the password is quit. You need to use scan.nextLine() to get the complete password. Please reference the textbook page 1194-1196 for the methods of String class. You must write 7 methods to check the following 7 security rules for a given password. Rule 1: Length invalid-The length of the password must be 8 to 12 only. Rule 2 No Space-The password must not contain any space or blank character. Rule 3: At least 2 digits-The password must contain at least 2 digits. Rule 4: At least 1 upper-case letter-The password must contain at least one upper-case letter. Rule 5: At least 1 lower-case letter-The password must contain at least one lower letter. Rule 6: At least 1 special character -The password must contain at least one special character, which can be one of the following 7 choices: '$', '#', '@', '&', '*', '?', or '!'. Rule 7: No special numbers -The password must not contain any of the following 4 numbers: 2017, 2016, 2015, or 2014. The following is a sample standard test, which must be your test case #1. You must also do test case #2 and test case #3 with different set of input data. Each test case must test at least 5 passwords with 2 secure and 3 non-secure. All those 7 violations must appear in those 3 non-secure passwords. Welcome to play the Password game! Please enter a password > 0 0 7 The password "00 7" violates the following rule Rule 1: Length invalid-The length of the password must be 8 to 12 only. Rule 2: No Space-The password must not contain any space or blank character. Rule 4: At least 1 upper-case letter -The password must contain at least one upper-case letter. Rule 5: At least 1 lower-case letter -The password must contain at least one lower-case letter. Rule 6: At least 1 special character-The password must contain at least one special character, which can be one of the following 7 choices: '$', '#', '@', '&', '*', '?', or '!'. Please enter a password > $007SLin! Congratulations! Your password "S007SLin!" is very secure! Please enter a password #1SimonLin The password "#1SimonLin" violates the following rule: Rule 3: At least 2 digits -The password must contain at least 2 digits. Please enter a password > SLin2016@ e password "SLin2016@" violates the following rule Rule 7: No special numbers -The password must not contain any of the following 4 numbers: 2017, 2016 2015, or 2014. Please enter a password > $2020LinWins Congratulations! Your password "S2020LinWins" is very secure! Please enter a password > quit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started