PA 7.3: Digital Rolodex 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 5.2: Digital Rolodex , but your implementation must define and invoke the following well-documented (including a JavaDoc above each one) functions:
- a function that asks the user for a contact's information and then adds it to the parallel vectors (called when the user chooses the "add contact" option)
- input: the three parallel vectors that store contact information
- return: nothing
- a function that asks the user for the index of a contact to remove and then removes it (called when the user chooses the "remove contact" option)
- input: the three parallel vectors that store contact information
- return: nothing
- a function that asks the user for a search phrase then displays all contacts that match (called when the user chooses the "search for contact" option)
- input: the three parallel vectors that store contact information
- return: nothing
- a function that displays all of the contacts and their index (called when the user chooses the "list contacts" option)
- input: the three parallel vectors that store contact information
For each function parameter, you must decide if it should be pass by reference or pass by value; only use pass by reference when necessary.
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.3 Digital Rolodex 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 user is presented with a menu with the options: add, list, remove, search, and quit
// [ ] if the user selects add they are prompted to enter each piece of information (name, phone number, email)
// [ ] if the user selects search, they are prompted to enter a search phrase and the contacts whose
// name contains the search phrase are displayed along with their indexes in the vectors
// [ ] if the user selects to list contacts, all contacts are displayed with their indexes
// [ ] if no contacts are present, a message saying as much is displayed
// [ ] if the user selects to remove a contact, they are prompted to enter the index of the contact
// to remove and that contact is removed from the vector by shifting every contact after the delete
// contact down one position in the vector and resizing the vector
// [ ] if the index is invalid (out of range of the vectors), an error message is displayed an
// the user is returned to the menu
// [ ] if the user select quit, the program ends
// [ ] the menu is shown again after processing the previous selection until they select to quit
// [ ] a function is defined and invoked correctly that adds a contact
// (inputs: the three parallel contact vectors, return: nothing)
// [ ] a function is defined and invoked correctly that removes a contact
// (inputs: the three parallel contact vectors, return: nothing)
// [ ] a function is defined and invoked correctly that lists contact
// (inputs: the three parallel contact vectors, return: nothing)
// [ ] a function is defined and invoked correctly that searches for a contact
// (inputs: the three parallel contact vectors, return: nothing)
// [ ] parameters are pass by reference only when necessary
If you are working with a partner, both of you must submit individually.