Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class that can be used for a Phone Book. The class should have attributes for the name and phone number. The constructor should

Create a class that can be used for a Phone Book. The class should have attributes for the name and phone number. The constructor should accept a name and a phone number. You should have methods that allow the name to be retrieved, the phone number to be retrieved, and one to allow the phone number to be changed. Overload the stream extraction operator to allow the name and number to be printed.
Write a program that creates a vector that can contain phone numbers. The program should prompt the user for an indeterminate number of phone numbers, create a phone number object, and add the object to the vector. After each phone number that is entered the program should display the phone number object that was just created and the total number of phone numbers in the list/vector. When the user has finished entering phone numbers into their phone book, the program should display the contents of the phone list (complete list of names/numbers).
And then write a separate program to meet criteria. Prompt the user and determine if they want to pre-populate their phone book vector from a file.
If so, the program will open the file specified and read in the series of names and numbers stored in the file.
After loading the names and numbers into the phone book vector (as specified by the user), prompt the user to determine if they want to add any additional names/numbers.
If so, allow the user to add as many new names/numbers as desired.
Display your final phone list in a formatted table.
Save all the entries in your phone book vector to an output file (in a format that you can use for input in step 1).
Extra Credit:
Overload the < operator for the phone book object.
Implement the vector sort method to ensure the phone book is sorted by either name or phone number prior to being saved in the output file.
In c++
Two separate programs

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions