Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help in Java : Write a telephone lookup program. Read a data set of 1000 names and telephone numbers from files that contain contact information

Help in Java :

Write a telephone lookup program. Read a data set of 1000 names and telephone numbers from files that contain contact information in a random order. (There will be no duplicates.) Use insertion sort for sorting. Handle lookups by name and lookups by phone number. Use a binary search for both lookups.

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

The data is in two separate files: one for the names and one for the phone numbers. There is one name on each line and one phone number on each line. Corresponding lines in the two files correspond to a single contact. For example, line 738 of the phone number file contains the phone number belonging to the person whose name is on line 738 of the names file.

The program should prompt the user with this message: Please enter a name or phone number, or * to quit. The user may enter a name or 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 No contact found. Repeat this until the user enters *.

Thanks !

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

1. Emphasis on line responsibility.

Answered: 1 week ago

Question

=+j Explain the relationship between unions and MNEs.

Answered: 1 week ago