Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Phone Book Problem: A Simple program is needed to keep track phone numbers. This program should allow you to enter a contact name and find

Phone Book
Problem: A Simple program is needed to keep track phone numbers. This program should allow you to enter a contact name and find that contacts phone number. When a contact is found, it is considered the current contact. The current contacts Phone number can be changed if needed. The Current contact may also be deleted. Names are considered Primary Key data in this structure and may not be duplicated or manipulated. Program should also allow you to print an alphabetical listing of contacts by last name, first name.
Design:
An interactive menu should give the following options:
Find Contact
Display current contact
Add Contact
Delete Current Contact
Display Contact List
Use a Binary Sorting Tree Data structure. Each node in the tree will be a contact object that holds the last name, the first name and the phone number of the contact. Additionally there are left and right pointers to additional contacts.
The Address Book object will manage the tree (add, sort, read and delete nodes). The find function will search for a last name first name combination, if found it will set the current pointer to that contact and return a true value. Display Current will display the first and last name and the phone number of the current node.
Use C++ programming!
image text in transcribed
Class Diagram: PhoneBook Attributes- Contact "root Contact current Methods PhoneBook0 bool addContact(string last, string first, string phonel bool removeContact(string last,string firs t) bool findContact(string last, string firs t) oid Dis playCurrent void Dis playList0 Contact Attributes string lastName string firstname string phone Contact left Contact right Methods Contact(string last, string first, string phone) string get ast Na me (0 string getFirst Na me 0: string getFullN ame0 string ge tN umber) bool setNumber(string number)

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

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

How could assessment be used in an employee development program?

Answered: 1 week ago