Question
Specifications 1.To be valid, a password must contain at least one uppercase letter, one lowercase letter, and one digit. In addition, its length must be
Specifications
1.To be valid, a password must contain at least one uppercase letter, one lowercase letter, and one digit. In addition, its length must be at least five characters. All characters except space, tab, and return are allowed.
2.Input. The program reads passwords from the user. During development, use your own test data, then test your final version against your test data, my test data, and classmates test data.
3.Output. The program initially outputs results to the screen, in the following format: password, validity, and errors if not valid. Sample output:
password: Happy888, valid
password: cat, invalid
-- no uppercase letter
-- no digit
-- too short (minimum of 5 characters)
Once your program is complete and correct, change output to go to a report file, in the same format, plus a report heading with your name, and the assignment name.
4.The program will have one class, named Password, and the following methods: main, default constructor if needed, greetUser (brief explanation of the program, written to the screen), readPasswordFromUser, checkCase, checkLength, checkValidty, printPasswordValidity (one password as above, with password, validity result, and error messages), addToReport (concatenates result of checking the current password to the report variable), and printReport (to file). You may use additional methods as needed.
5.Variables. With few exceptions, all variables should be at the instance level; do not use static. Main will contain an object variable of Password type to call the other methods.
6.Logic. You may use methods from the String and Character classes as needed. Do not use any built-in methods that do a substantial part of this project.
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