PA 4.1: Password generator++
- Due Mar 23, 2021 by 11:59pm
- Points 10
- Submitting a file upload
- File Types cpp
- Available after Mar 9, 2021 at 2pm
When completing this programming assignment, you may work with up to one other person. No groups of more than two are permitted.
This is similar to PA 3.2: Password generator+ , except:
- the program should ask the user to enter the desired password length directly (e.g., 5, 10, 12, 20, 100, etc.) rather than select from the options "short", "medium", and "long"
- the program should ask the user to enter how many random passwords to generate, and the program will generate that many (instead of only one password)
For example, consider the following run of the program that generates 5 passwords, each of length 15 characters, and consisting of random upper case, numeric, and special characters (orange text is the user input):
$ ./pa5.1.exe
==== PASSWORD GENERATOR ====
What character groups would you like to include in the generated passwords? Enter one or
more of the following on the same line:
uppers -- upper case letters A-Z
lowers -- lower case letters a-z
nums -- numbers 0-9
specials -- special characters (!@#$%^&*()-_[]'";:.,><~`\|)
> uppers specials nums
Enter the number of characters should each password have: 15
Enter the number of passwords would you like to generate: 5
Passwords:
----------
A834#,3$3IUN#,(
.~MX@;)LF9$-^,%
Z~SHXVL4Z@]_.,U
DH8~~(SIV,"6!$0
4`":Q#9F6<$SMY%
Copy the following header and specifications checklist and paste it at the top of your source code. As you complete the specifications, fill in the [ ] next to that specification in the check list (e.g., like this: [x]). I will not grade submissions with missing specifications; please do not submit if you cannot check all of them off. This specs checklist is essentially a way for you to self grade before you submit your program.
// Name:
// Date:
// Partner:
//
// Specifications checklist for PA 4.1
//
// General specs:
// [ ] the header includes your name and anyone you worked with
// [ ] the header includes this specifications checklist with all completed
// specifications checked off: [x]
// [ ] the code is indented properly (inside of every block, code is indented
// one more tab)
// [ ] each chunk of code that "hangs together" (works toward a higher level goal):
// [ ] includes a brief, useful comment above it
// [ ] is separated from the next chunk by a blank line
// [ ] there are no really long lines of code or comments (if you have long
// lines, split them across multiple shorter lines)
// [ ] identifiers are well named
// [ ] the program compiles
// [ ] the program runs without crashing or hanging
// [ ] all output and prompts look clean (correct spelling, capitalization,
// nothing squished)
// [ ] all prompts make it clear what data the user is expected to enter and in
// what format and work as expected
//
// Specific specs:
// [ ] the program prompts the user for a line of input that include each of the character
// groups they want to include in their password
// [ ] the valid group options are: uppers (A-Z), lowers (a-z), nums (0-9),
// specials (!@#$%^&*()-_[]'";:.,><~`\|)
// [ ] each character group is stored in its own constant string, defined at the top of main,
// using the proper conventions (the constant names are all caps)
// [ ] the program uses branches to decide whether to add each character group to the string
// of characters to generate the password from
// [ ] the program prompts the user for the length of the passwords once at the beginning (not for each password)
// [ ] each generated password is of that length
// [ ] the program prompts the user for the number of passwords to generate
// [ ] the program generates as many passwords as specified by the user
// [ ] each password is generated randomly using only characters from the user-specified groups
// [ ] `srand(time(0))` is used once at the beginning of the program to provide random results on
// each run of the program rather than `srand(1)` or something similar
// [ ] the program uses the appropriate loop types
If you are working with a partner, both of you must submit individually.