Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use c++ to write this assignment. Programming requirements: You will be creating two classes, PhoneBook and PhoneBookEntry 1. class PhoneBookEntry 1) You will have

please use c++ to write this assignment.

Programming requirements:

You will be creating two classes, PhoneBook and PhoneBookEntry 1. class PhoneBookEntry

1) You will have two private member variables:

a. The fullName, you may use string or c-string as the datatype

b. The telephone, again you may use string or c-string as the data type. The phone number format is xxx-xxx-xxxx. 2) Please create related constructor(s), getter or/and setter methods, or/and other methods if needed.

2. class PhoneBook

1) You will have two member variables:

a. an array of 10 elements of PhoneBookEntry, for example:

PhoneBookEntry[10] myPhoneBook;

b. the name of the phone book, for example:

string phoneBookName; // you may use c-string for this variable as well 2) Please create two constructors, one is the default constructor, the other with parameters, for example:

PhoneBook(PhoneBookEntry[] input, string phonebookname);

PhoneBook();

3) Please create the necessary setters and getters

4) Please create the following additional methods:

a. modify an entry in the phoneBookEntry list;

b. display the PhoneBook; and

c. search for an entry (or entries) per name (full name or partial name)

d. search for an entry per a phone number.

You may use the following data as your PhoneBookEntry list if you wish:

"Alejandra Cruz","201-555-1223",

"Joe Looney", "212-555-0097",

"Geri Palmer", "917-555-8787",

"Li Chen", "646-555-1212",

"Holly Gaddis", "914-555-8878",

"Sam Wiggins", "201-555-0998",

"Bob Kain", "212-555-8712",

"Tim Haynes", "718-555-7676",

"Jean James", "201-555-4939",

"Ron Palmer", "646-555-2783"

The program should ask the user to enter a name or partial name (either first name or last name) to search for in the array. Any entries in the array that match the string entered should be displayed.

For example, if the user enters Palmer the program should display the following names from the list: Geri Palmer 917-555-8787

Ron Palmer 646-555-2783

But the user should search for the full telephone number, not partial phone number.

3. class main or another class name to your liking

Please create one or two PhoneBook instance(s).

Please perform modify an entry, search per name, and search per a phone number to the instance(s).

You should hand in 5 files (two for PhoneBook class, two for PhoneBookEntry class and one for main class)

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_2

Step: 3

blur-text-image_3

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

Students also viewed these Databases questions