Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project Title: Contacts Goal: The goal of this assignment is to help students familiarize themselves with the following C++ programming concepts 1. Input/Output to and
Project Title: Contacts Goal: The goal of this assignment is to help students familiarize themselves with the following C++ programming concepts 1. Input/Output to and from the console 2. Storing data in a file and reading data from a file 3. Review of functions 4. Arrays and/or Vectors 5. Working with character strings 6. Structs Description: For this assignment you will create a program to manage phone contacts. Your program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. Your program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2. Add a new contact. 3. Search for a contact given the contact's first or last name. 4. Delete a contact 5. Exit program. To represent a contact in your program, create a struct named Contact with the following fields firstName string lastName - string phoneNumber - long * phoneType - enum PhoneType The PhoneType can be only one of the following: "CELL", "HOME", "WORK". When the program first loads, it reads all the saved contacts (if any) from a file named database.txt into an Array or Vector. While the program is running, the user can choose any of the 5 available options. When the user selects the option 5 (exit program), the program stores the current contents of the Array or Vector to the file (replacing the old contents) and exits. During the program Vector will be updated. The database.txt file will be updated automatically only when the program is about to exit. In other words, when the user selects option 5, the program first saves all the contents of the Array or Vector into the text file, and then exits execution, if the user chooses to add or delete items, only the Array or The format of the contents of the database.txt file should be in human readable plain text, one record per line (note the separator between different entries) For example Shawn Seals 5124567890 0 Ted Sheckler~2104567890~2 Chip Chipperson 9404567890~1 For display, contacts should be printed to the console in the following format. Chip Chipperson, Home (940)456-7890 Shawn Seals, Cell (512)456-7890 Ted Sheckler, Work (210)456-7890
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started