Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program Description: Write a program to ask user to enter a password and validity the password. The password should be 820 characters long ( 8
Program Description: Write a program to ask user to enter a password and validity the password. The password should be 820 characters long ( 8 is acceptable and 20 is acceptable), it should contain at least one uppercase letter and one lower case letter. The password should contain at least one digit, and at least one symbol other than alphabets or numbers. Most importantly, a password may not contain any white space. Functions: You will need the following functions, do not change function header including the parameter. Add more if needed. Your main function should be less than half a page. You should have the following variables in main: string password; \begin{tabular}{|l|l|} \hline Function header & Purpose \\ \hline void get Input (string \& password) & Thefunctiontakesuserinputandsaveitintothe"password"inputparameter.Errormessagemustbedisplayedotherwise. \\ \hline bool checkLength (string password) & Thepasswordmustbeatleast8characterslong.Andnomorethan20-characterslong.Errormessagemustbedisplayedotherwise. \\ \hline bool checkCase (string password) & Thepasswordmustcontainatleastoneuppercaseandatleastonelowercaseletter.Errormessagemustbedisplayedotherwise. \\ \hline bool checkDigit (string password) & Thepasswordmustcontainatleastonedigit.Errormessagemustbedisplayedotherwise. \\ \hline bool checkAlpha (string password) & Thepasswordmustcontainatleastonealphabet.Errormessagemustbedisplayedotherwise. \\ \hline bool checkSymbol (string password) & Thepasswordmustcontainatleastonesymbolthatisnotalphanumeric".Thepasswordmustcontainatleastonedigit.Errormessagemustbedisplayedotherwise. \end{tabular} The program should ask for a password and then verify that it meets the stated criteria. If it doesn't, the program should display a message telling the user why it fails with all the applicable mistakes, and then ask for re-entry until it is correct. Your program should echo the correct password (shown in the sample output) Sample Output (be sure to display all applicable error messages): 1. Follow programming style guideline very carefully. 2. Your output style has to match with my output shown (although you can try different user input). 3. All functions must have prototypes. 4. Your main function should only declare the variables and call the functions. (shorter than half a page) 5. Store all values as variables, do not hardcode any values. . Use constant variables as much as possible 6. NO global variables in this assignment
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