Lab 5: Storing information in lists
Contents
Instructions
In this lab, you will work with a partner to create a digital Rolodex. Your program should use arrays to keep track of the following information about contacts:
- last name
- first name
- email address
- phone number
The program should ask the user to select one of four options:
- add a contact
- find a contact
- list all contacts
- quit
The "add a contact" option should cause the program to prompt the user to enter the new contact's information (see above). The "find a contact" option should prompt the user for the last name of the contact and print out that contact's information if the last name is found, or "Contact not found" otherwise. The "list all contacts" option should list all of the contacts that have been added. The program should keep re-running until the user selects the "quit" option.
Hint 1: it may be helpful to use parallel arrays, one for each piece of information.
Hint 2: if you make an array really big, you don't have to fill it up and you also don't have to worry about running out of space if you're only expecting users to enter a handful of contacts.
Challenge 1
Add an option to update an existing contact.
Challenge 2
Allow finding users on fields other than last name.
Challenge 3
Add an option to delete a contact.
Challenge 4
Store the contacts information to a file and load that information when the program starts up (you can ask a user for a filename or used a fixed filename). See the File IO chapter for details on writing to and reading from files.
Submission
Submit your .cpp files to here. You can view the rubric here.
(Back to top)