Question: Write a telephone lookup program. Read a data set of 1000 names and telephone numbers from files that contain contact information. Your program has to

Write a telephone lookup program. Read a data set of 1000 names and telephone numbers from files that contain contact information. Your program has to work like a caller ID system, where given a number it displays the name. (There will be no duplicate names or numbers.) Use selection sort for sorting. Use a binary search for lookup.

The program has to do two things: read in the data and handle user queries.

1. The data is in two files. For each person, the name is listed in one file and the phone number is listed in the other. The first phone number belongs to the first person, the second number to the second person etc. Create a Contact class (name and phone number are the only attributes), make Contact objects and put them in an array.

2. The program should prompt the user with this message: Please enter a phone number, or * to quit. The user enters a phone number, and the program prints the name and the phone number (separated by a space) for the corresponding contact. If a match cannot be found, the program should print Unknown number. Repeat this until the user enters *.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!