Question: Write a code that asks the user for a size of a random generated password, the number of integers, characters ( uppercase and lowercase )

Write a code that asks the user for a size of a random generated password, the number
of integers, characters (uppercase and lowercase) and special characters and generates a
password based on this requirement.
The code should do the following:
1. Ask the user to enter the size of the password up to 20 characters.
2. Using this size as an input, ask the user for the distribution of numbers, characters
(both upper case, and lower case), and special characters. All of this must have a
positive number (cannot be zero), and must be equal to the size of input.
3. Using the ASCII character set and rand() function, generate the appropriate password.
4. Check and ensure that no number, character or special character appears more than
once in the password.
5. Use a shuffle to ensure that the types are randomly distributed.
6. Display the generated password for the user in the console.
The following error checking should be done:
1. The correct size of the input.
2. The correct distribution of characters.
The program should terminate when the console input is "exit". Each iterations should
display a different password with the same inputs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!