Docsity

CS 331 Project #5 Phone Book Application, Study Guides, Projects, Research of Data Structures and Algorithms

Toggle sidebar
bg1
CS 331 Project #5 Nov. 1, 2004
Due at start of class on Wednesday, Nov. 10, 2004
50 points.
Refer to Problem #5, page 496, Textbook.
Write a program that provides a ay for you to store and retrieve telephone number. Design a user
interface that provides the following operations:
Add: Adds a person’s name and phone number to the phone book.
Delete: Deletes a given person’s name and phone number from the phone book, given
only the name.
Find: Locates a person’s phone number, given only the person’s name.
Change: Changes a person’s phone number, given the person’s name and new phone
numbers.
Quit: Quits the application, after first saving the phone book in a text file.
Design and implement the class Person (refer to page 455, textbook) 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 member. 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 class PhoneMenu, which provides the program’s user interface.
Write a client program (P5xxx.java) which instantiates a PhoneMenu and then performs:
1. Find Amy S Heyen’s phone number.
2. Find phone number for Randy Harris.
3. Delete Ronda Peck from the phone book.
4. Delete Michelle T Cason from the phone book.
5. Change Greg Tanner’s phone number to (111)435-1111
6. Change the phone number for Barbara D Ramsey to (333)435-3333
7. Add Robert Adams, (444)435-4444 to the phone book.
8. Add Mary N Zimmerman, (555)435-5555 to the phone book.
9. Quit the menu, then restart the PhoneMenu
10. Find Barbara D Ramsey’s phone number.
pf2

Partial preview of the text

Download CS 331 Project #5 Phone Book Application and more Study Guides, Projects, Research Data Structures and Algorithms in PDF only on Docsity!

CS 331 Project #5 Nov. 1, 2004

Due at start of class on Wednesday, Nov. 10, 2004 50 points.

Refer to Problem #5, page 496, Textbook.

Write a program that provides a ay for you to store and retrieve telephone number. Design a user interface that provides the following operations:

Add: Adds a person’s name and phone number to the phone book. Delete: Deletes a given person’s name and phone number from the phone book, given only the name. Find: Locates a person’s phone number, given only the person’s name. Change: Changes a person’s phone number, given the person’s name and new phone numbers. Quit: Quits the application, after first saving the phone book in a text file.

Design and implement the class Person (refer to page 455, textbook) 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 member. 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 class PhoneMenu, which provides the program’s user interface.

Write a client program (P5xxx.java) which instantiates a PhoneMenu and then performs:

  1. Find Amy S Heyen’s phone number.
  2. Find phone number for Randy Harris.
  3. Delete Ronda Peck from the phone book.
  4. Delete Michelle T Cason from the phone book.
  5. Change Greg Tanner’s phone number to (111)435-
  6. Change the phone number for Barbara D Ramsey to (333)435-
  7. Add Robert Adams, (444)435-4444 to the phone book.
  8. Add Mary N Zimmerman, (555)435-5555 to the phone book.
  9. Quit the menu, then restart the PhoneMenu
  10. Find Barbara D Ramsey’s phone number.

CS 331 Project #5 Nov. 1, 2004

Folder cs331P5 contains: TreeNode.class, KeyedItem.class, FullName.class, TreeException.class, BinaryTreeBasis.class, Person.class, BinarySearchTree.class, Node.class, QueueException.class, QueueInterface.class, QueueReferenceBased.class, TreeIterator.class and cs331Phones.dat.

The binary file cs331Phones.dat contains the instance of class BinarySearchTree of 766 names with their phone numbers stored in the structure of binary search tree.

In order to restore the BinarySearchTree instance saved in cs331Phones.dat, you must include the original classes, which are stored in the folder cs331Prj5, that were used to create the binary file for the instance.