Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

help c++ please ! Create a program to utilize the given C++ class (do not change the class given to you). The program will use

help c++ please ! 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 users
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:
ive attached my starting files that comes with it . person.h , person.cpp , contacts.txt. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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 - 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! Exampli Miscellaneous Files liscellaneous Files [fjLastlame=Last; No issues found Miscellaneous Files contacts - Notepad File Edit Format View Help John Lennon 555-5555 frontman@beat les.com Ringo Starr 456-123-7890 drums@beatles.com Paul McCartney 123 -456-7890 newband@wings - com George Harrison 789-654-4321 aguy@beatles.com Stevie Wonder 543678-0631 adude@music.gov

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago