Question: Create a program to utilize the given C++ class (do not change the class given to you). The program will use the Person class to

 Create a program to utilize the given C++ class (do notchange the class given to you). The program will use the Personclass to aid in creating an address book to manage the user'scontacts. The initial contact list will be loaded from a file. Thefile contacts.txt has been provided for you as a base point. Eachrow in the file should be organized like so: firstName lastName phoneNumberemailAddress Each item will be separated by a single space. Your main

Create a program to utilize the given C++ class (do not change the class given to you). The program will use the Person class to aid in creating an address book to manage the user's contacts. The initial contact list will be loaded from a file. The file contacts.txt has been provided for you as a base point. Each row in the file should be organized like so: firstName lastName phoneNumber emailAddress Each item will be separated by a single space. Your main program should have four functions: - main Parameters: none Return values: 0 Purpose: refer to main program guidelines below - readContacts Parameters: contacts vector, opened file OR string filename Return values: nothing OR string filename Purpose: read the contents of the file in a loop. Populate a Person object with each appropriate item and add that Person to your Contacts vector. - addContacts Parameters: contacts vector, string filename Return values: none Purpose: get input from the user for first name, last name, phone number, and email - add where appropriate to the vector and file (hint: this will REQUIRE altering the file) - displayContacts Parameters: contacts vector Return values: none Purpose: display your vector contents Either: loop to verify a valid file for opening and THEN call the read contacts with an opened file. OR, call the read contacts with your vector and file name and verify the file exists in the function. You should return the valid file name back to the main so it's saved for use in functions like add contacts. Then, display a menu to the user. Loop while they want to continue in the program. - Exit - Display Contacts C Calls display function - Add Contacts C Calls add contacts function - Incorrect menu option Displays error in case the user has entered an invalid option Hints: Your vector should NOT be a global - but, also, no functions return the vector. Keep in mind, your vector should retain changes made in functions. How can we grant this behavior? Passing by...? If you're passing an opened file in read mode to your read contacts function, this must also mimic the parameter type referenced in the first part of this hint! R. Aod contoct What would you like to do? 1 Address book: Contact 1: Nane: John Lennon Phone number: 555-5555 Enatl address: frontmanabeat les. con Contact 2: Nane: Ringe 5 tarr Phone number: 456-123-7890 Enall address: drunsebeatles, con Contact 3: Nane: Paul McCartney Phone number: 123-456-7899 Enath address: newbandewings, con Contact 4; Nane: George Harrison Phone number: 789-654-4321 Enatl address: aguyebeat les. con Menu: 0. Exit 1. Display Address Book 2. Add Contact what would you like to do? 2 Here's where we'll gather the information. what is the first nane? Stevie what is the last nane? Wonder what's the phone number (no spaces)? 543-678-0631 what's the enall address? adudeemustc.gov Menu: 0. Exit 1. Dtsplay Address Book 2. Add Contact what would you like to do? 3 That's not a valid option. Try again. Menu: 0. Exit 1. Display Address Book 2. Add Contact what would you like to do? Good-bye! Joun lennon 5555555 front narebeatles, con Ringo Starr 456-123-7990 drunsgbeatles.con Paul MeCartney 123-456-7896 nenterndipings, can Eeorge Harrison 7g9-654-4321 agdygheatles.con Stevie Wonder 543-678-8631 aduderusic. gov Finelude tring? uning wt.d: s wtring; Iifndef eRR.JN 11 Idstine EER.OWN-71 d.8.5. P6rson 1 prizate : strinaq firstkane: otring lastNane: etring plowa; leg vacil; publie: Bmrman ( ) if gattar* string get.irst.1ame (); etring get.lis stiare [1; string getehone }; string getErail } i f setters void aetpiratkane (atring firat): void eotlsotkone (atilng lati: void eatihone (atriay phona); void uLanil (ulajay umail); 3i Fendie / perscer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!