PA 3.2: Password generator+
- Due Mar 16, 2021 by 11:59pm
- Points 10
- Submitting a file upload
- File Types cpp
- Available after Mar 2, 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.
In this programming assignment, you will modify the password generator form zyLab 3.21 so that it works as follows:
- four character groups are coded in constants at the top of main (upper case, lower case, numbers, and special characters)
- e.g., the constant for uppercase letters might look like this: const string UPPER_CASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- the user should be prompted to enter a line of input specifying each of the groups they want to include:
- example 1: if the user enters `uppers lowers nums specials`, it means include all the groups
- example 2: if the user enters `uppers lowers`, it means include just the alphabetical characters
- use if statements to add each group the grand character list
- you should only need four if statements for this
- also prompt the user to select the length: short (5 chars), medium (10) or long (20)
- use branches to handle each of these three cases
- you will need a lot of copying and pasting for these...
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 Option 3.2
//
// 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:
// [ ] your 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)
// [ ] your program uses branches to decide whether to add each character group to the string
// of characters to generate the password from
// [ ] your program prompts the user for the size of the password: one of short (5 characters),
// medium (10 characters), or long (20 characters)
// [ ] each case is handled with a branch
// [ ] the password is generated randomly using only characters from the user-specified groups
// [ ] `srand(time(0))` is used rather than `srand(1)` or something similar
If you are working with a partner, both of you must submit individually.