I'm looking for help on a code I'm working on. The instructions are: Passwords must be a minimum of 12 characters and require both upper and lower case letters, at least one number and one special characters. Program must ask the person the following: 1) The length of the password (number of characters) to be generated. 2) How many upper case characters are required. 3) How many lower case characters are required. 4) How many numbers are required. 5) How many special characters are required. Once input is complete, the program will generate a password that meets those requirements.
I'm pretty new at coding and this is an assignment for my coding class. So don't shame me if it's really easy.
I'm not doing your homework for you. However, you could do this in an inefficient, yet straightforward manner.
Build the user input program to store the options in variables. Make sure to validate their input against your requirements (e.g. minimum of 12 chars).
Build several arrays - one for each type of character (e.g. array for UpperCase, array for LowerCase, array for Numbers, etc.)
Use a random number generator that will give you an index for each array, depending on the requirements, as many times as desired.
You can even access the arrays in a random order, thus ensuring that we don't always start with Uppercase letters, for example.
That should give you a high-level way to attack this problem without giving you any code of any answers.
Good luck!