Question: c++ please ! i can NOT change the class given to me . still learning my way around c++ CSE 1384 - Classes Lab 5

c++ please ! i can NOT change the class given to me . still learning my way around c++  c++ please ! i can NOT change the class given to
me . still learning my way around c++ CSE 1384 - Classes
Lab 5 Objectives: - Continue practicing past concepts - Practice using basic
C*+ classes Assignment: Create a program to utilue the given C++ dass
(do not change the class given to you). The progam will use
the Person class to aid in creating an address book to manage
the user's contacts. The inital contact list will be loaded from a

CSE 1384 - Classes Lab 5 Objectives: - Continue practicing past concepts - Practice using basic C*+ classes Assignment: Create a program to utilue the given C++ dass (do not change the class given to you). The progam will use the Person class to aid in creating an address book to manage the user's contacts. The inital contact list will be loaded from a fie. The file contacts. txt has been provided for you as a base point. Each row in the file sheuld be erganiaed lie so: firstiane lastiane phonekunber ensiladdress Each item wit be separated by a single space. Your main program should have four functions: - main - Parameters: none - Peturn values: 0 - Purpose refer to main program quidelines below - readContacts Paramelers: contads vector, opened file OR string flename - Return values: nothing OR sting fiename - Purpose: read the contents of the fie in a loop. Populate a Person object with each appropriate item and asd that Person to your Cortacts vector. - addContacts - Paramesers: contacts vector, atring flienane - Return values: none - Purpose: get input trem the vee for first name, last name, shone number, and email - add where appropriate to the vector and fie thint this wil RECUIRE altering the file) - displayContads - Paramesers: contads vecter - Peturn values none - Purpose display your vector contents Main program: Create a Perssn type vector and receive a sting fie name. Either: 1000 to verity a valid flle for opening and THEN call the read contacts with an cpened fle. OR, cal the read contacts with your vector and file name and verity the fiee exists in the function. You sheuld return the vaid tle name back ts the main so its saved for use in functisns ike add contacts. Then, display a menu to the user Loop while they want to continue in the program. - Exit - Exits the menu/program - Display Contacts - Cals display function Main program: Create a Person type vector and receive a string file name. 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 - Exits the menu/program - Display Contacts - Calls display function - Add Contacts - 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! Example Execution: Miscellaneous Files: minetude "person, h " (Global Scope) [ [ f f roturn Parsentigetias: Estring Durson: igeten [Astring Persontigot: fl sucters G onda forfiontisetrirstabino(string first) firsthane = firsty Mo mines totind Miscellaneous Files (clabal Seope) tiscellaneous Files (Global Scope) =include sstrings using std: istring; ifndef PERSONLH \#define PERSON_H aclass Person f private: string firsthane; string Lastilame; string phone; string easil; public: Persond; If getters string getfirstnaned; string gett asthaned; string getphoned; string getendix 0 ; If setters void setfirstane(string first); vodd setl ast Mive(string fast); void setphone(string phone); vaid sethitil (string phone); llendif // preson-H File Edit Format View Help John Lennon 555-5555 frontmanebeatles.com Ringo Starn 456-123-7890 drumspbeat les.com Pau1 McCartney 1234567890 newband@wings. com George Harrison 7896544321 aguyebeat tes - com Stevie Wonder 543-678-0631 adudegmusic. gov CSE 1384 - Classes Lab 5 Objectives: - Continue practicing past concepts - Practice using basic C*+ classes Assignment: Create a program to utilue the given C++ dass (do not change the class given to you). The progam will use the Person class to aid in creating an address book to manage the user's contacts. The inital contact list will be loaded from a fie. The file contacts. txt has been provided for you as a base point. Each row in the file sheuld be erganiaed lie so: firstiane lastiane phonekunber ensiladdress Each item wit be separated by a single space. Your main program should have four functions: - main - Parameters: none - Peturn values: 0 - Purpose refer to main program quidelines below - readContacts Paramelers: contads vector, opened file OR string flename - Return values: nothing OR sting fiename - Purpose: read the contents of the fie in a loop. Populate a Person object with each appropriate item and asd that Person to your Cortacts vector. - addContacts - Paramesers: contacts vector, atring flienane - Return values: none - Purpose: get input trem the vee for first name, last name, shone number, and email - add where appropriate to the vector and fie thint this wil RECUIRE altering the file) - displayContads - Paramesers: contads vecter - Peturn values none - Purpose display your vector contents Main program: Create a Perssn type vector and receive a sting fie name. Either: 1000 to verity a valid flle for opening and THEN call the read contacts with an cpened fle. OR, cal the read contacts with your vector and file name and verity the fiee exists in the function. You sheuld return the vaid tle name back ts the main so its saved for use in functisns ike add contacts. Then, display a menu to the user Loop while they want to continue in the program. - Exit - Exits the menu/program - Display Contacts - Cals display function Main program: Create a Person type vector and receive a string file name. 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 - Exits the menu/program - Display Contacts - Calls display function - Add Contacts - 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! Example Execution: Miscellaneous Files: minetude "person, h " (Global Scope) [ [ f f roturn Parsentigetias: Estring Durson: igeten [Astring Persontigot: fl sucters G onda forfiontisetrirstabino(string first) firsthane = firsty Mo mines totind Miscellaneous Files (clabal Seope) tiscellaneous Files (Global Scope) =include sstrings using std: istring; ifndef PERSONLH \#define PERSON_H aclass Person f private: string firsthane; string Lastilame; string phone; string easil; public: Persond; If getters string getfirstnaned; string gett asthaned; string getphoned; string getendix 0 ; If setters void setfirstane(string first); vodd setl ast Mive(string fast); void setphone(string phone); vaid sethitil (string phone); llendif // preson-H File Edit Format View Help John Lennon 555-5555 frontmanebeatles.com Ringo Starn 456-123-7890 drumspbeat les.com Pau1 McCartney 1234567890 newband@wings. com George Harrison 7896544321 aguyebeat tes - com Stevie Wonder 543-678-0631 adudegmusic. gov

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!