PA 7.1: Password generator++ with functions
- Due Apr 13, 2021 by 11:59pm
- Points 10
- Submitting a file upload
- File Types cpp
- Available after Mar 30, 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 programming assignment has all the same functionality as PA 4.1: Password generator++, but your implementation must define and invoke the following well-documented (including a JavaDoc above each one) functions:
- a function that processes the user's character group input (the line where they enter, for example, "uppers specials") and generates a string of characters that combines all the specified groups
- input: a string of character group names (e.g., "lowers nums")
- return: the string of characters from the specified character groups (e.g., "abcdefghijk....0123456789")
- a function that generates a password
- input: the length of the password, the string of characters to sample the password from
- return: a randomly generated password (a string of the specified length with characters sampled from the second parameter)
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 7.1: Password generator++ with functions
//
// 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
// [ ] every function includes a JavaDoc above it that specifies all present
// parameters and return values.
//
// 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
// [ ] a function is defined and invoked correctly that parses the user's character group selections
// (inputs: a string containing the names of character groups to include,
// return: a string containing the characters from the specified character groups)
// [ ] a function is defined and invoked correctly that generates a password
// (inputs: the length of the password, a string containing the characters to sample the password from,
// return: a randomly generated password of the given length using only characters from the second parameter)
If you are working with a partner, both of you must submit individually.