Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C + + Programming Language: Requirements - working with the String Class and Test Cases Using the String Class, design, develop, and test a password

C++ Programming Language: Requirements - working with the String Class and Test Cases Using the String Class, design, develop, and test a password validation program that requests a password from the user, and validates it based on the following criteria. The password must be at least 8 characters long, contain at least one number, and at least one upper case letter, and at least one lower case letter. The user is limited to three (3) attempts and is then locked out the program ends). At the end of main, add your Test Cases (10 points) as comments in the code (see below). Required functions called from main and located in a header file: prompt for and getting input, and validating the password. The main loop can be in main. 1. Request a password from the user 1. a. Test to see if the password entered is valid (length, upper case, lower case, digit) If the password is not valid: i. Output the original password entered ii. Output that it is not a valid password iii. Output each of the reasons why the password is not valid iv. Then prompt again for a password (start over), unless three (3) attempts have been made. b. If the password is valid, output the password and that it is valid and end the program. 2. The user is allowed three (3) tries to enter a valid password. After three failed attempts, output that the session has been "locked" and end the program. Required functions: getting input, and validating the password. The program must use the string class, not cstring. Main should only contain the variable declarations, program loop, and calls to functions for getting the input, validating the password, and showing output. Test Cases (10%): Below main as comments using the template one the next page. references: String Class (Chapter 10.7- page 591), isdigit, isupper, islower - page 558, myString.at(x)- page 598 myString.length()- page 599Test Case Template (include as a comment section below main): Engineer Name: Your Name Project/program description: A description of the program and operation (what does it do?) Test Case #1: describe the test Results: Test Case #2: describe the test Results: Test Case #3: describe the test Results: Test Case #n: describe the test Results: Test your program before submission and document the test cases as comments below main. Invalid Entry Enter a password that contains: At least eight (8) characters, including at least one number, at least one upper case letter, and at least one lower case letter. Password: 1 uppermissing 1 uppermissing is not a valid password. It does not contain an upper case letter. Enter a password that contains: At least eight (8) characters, including at least one number, at least one upper case letter, and at least one lower case letter. Password:Invalid Entry 2 items missing Enter a password that contains: At least eight (8) characters, including at least one number, at least one upper case letter, and at least one lower case letter. Password: LOWERANDNUMBERMISSING LOWERANDNUMBERMISSING is not a valid password. It does not contain a lower case letter. It does not contain a number. Invalid Entry third attempt Enter a password that contains: At least eight (8) characters, including at least one number, at least one upper case letter, and at least one lower case letter. Password: thirdAttempt thirdAttempt is not a valid password. It does not contain a number. >>>> That was the third attempt. This session has been locked. execution time : 298.196 s rocess returned 0(0x0) Press any key to continue.Valid Entry Enter a password that contains: At least eight (8) characters, including at least one number, at least one upper case letter, and at least one lower case letter. Password: UpperLower34 Upper Lower34 is a valid password execution time : 10.396 s Process returned o (Oxo) Press any key to continue.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

Evaluate the integral. 1 0 x 3 x dx

Answered: 1 week ago

Question

2.3 Define human resource ethics.

Answered: 1 week ago

Question

9 How can training be evaluated?

Answered: 1 week ago