Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program for the following . Password Verifier Imagine you are developing a software package that requires users to enter their own passwords.

Write a C++ program for the following .

Password Verifier

Imagine you are developing a software package that requires users to enter their own passwords. Your software requires that users' passwords meet the following criteria:

The password should be at least 6 characters long.

The password should contain at least one uppercase and at least one lowercase letter.

The password should have at least 1 digit.

Write a program that asks for a password and then verifies that it meets the stated criteria. If it doesn't the program should display a message telling the user why.

Expected Output

When your solution is executed, it must match, verbatim, the following output, depending upon the use case:

User accepts auto-generated password

Enter your full name, including middle initial: Stu D. Ent Your auto-generated password is: tnEDutS10 Would you like to change your password now [Y|N]? N Thank you. It is recommended that you change your password the next time you log into our system. 

User changes password successfully

Enter your full name, including middle initial: Stu D. Ent Your auto-generated password is: tnEDutS10 Would you like to change your password now [Y|N]? Y Enter your password: Passw0rd Thank you. Please use your new password the next time you log into our system. 

User changes password unsuccessfully

Enter your full name, including middle initial: Stu D. Ent Your auto-generated password is: tnEDutS10 Would you like to change your password now [Y|N]? Y Enter your password: password We're sorry. Your password does not meet our requirements: * Your password does not contain at least one uppercase and one lowercase letter * Your password does not contain at least 1 digit Your password was not changed; it remains: tnEDutS10 As a reminder, your password should * be at least 6 characters long * contain at least one uppercase and at least one lowercase letter * contain at least 1 digit It is recommended that you change your password the next time you log into our system. 

Algorithm for auto-generated passwords

The auto-generated passwords are generated from the user's name as follows:

The user's name is reversed, removing any white space or period characters ('.')

If the user entered their name in all uppercase or all lower case, the algorithm treats the name as if it were entered with the proper case as shown in the above examples.

The length of the name entered -- including any white space and punctuation -- is appended to the end of the auto-generated password.

If the user entered a name that is less than 6 characters, the number 6 is appended to the end of the reversed name until the password is 6 characters long.

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

What is (are) the invoice number(s) of the duplicate payments?

Answered: 1 week ago

Question

describe the main employment rights as stated in the law

Answered: 1 week ago