Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using trees that provides a way for you to store and retrieve telephone numbers. Design a console program that provides the following

Write a program using trees that provides a way for you to store and retrieve telephone numbers. Design a console

program that provides the following operations:

Add:

Adds a persons name and phone number to the phone book.

Delete:

Deletes a given persons name and phone number from the phone book, given only the name.

Find:

Locates a persons phone number, given only the persons name.

Change:

Changes a persons phone

number, given the persons name and new phone number.

Quit:

Quits the application, after first saving the phone book in a text file.

You can proceed as follows:

Design and implement the class

Person

, which represents the name and phone number of a

person.

You will store instances of this class in the phone book.

Design and implement the class

PhoneBook

, which represents the phone book. The class should

contain a binary search tree as a data field. This tree contains the people in the book.

Add methods that use a text file to save and restore the tree.

Design and implement the classMenu, which provides the programs user interface.

The program should read data from a text file when it begins and save data into the text file when the user quits the program

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

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

Did the team members feel that their work mattered

Answered: 1 week ago