Problem

Directory Assistance Have you ever tried to call someone at a place of business and...

Directory Assistance Have you ever tried to call someone at a place of business and been told to enter letters of the person’s name on your telephone’s keypad in order to connect to his or her extension? Write a program to simulate this type of directory assistance. Suppose the names and telephone extensions of all the employees of a company are contained in the text file Employees.txt. Each set of three lines of the file has three pieces of information: last name, first and middle name(s), and telephone extension. (We have filled the file with the names of the U.S. presidents so that the names will be familiar.) The user should be asked to press buttons for the first three letters of the person’s last name followed by the first letter of the first name. For instance, if the person’s name were Gary Land, the user would type in 5264. The number 5264 is referred to as the “push-button encoding” of the name. Note: People with different names can have the same push-button encoding—for instance, Herb James and Gary Land. After the user presses four keys on the keypad, the program should display the names and extensions of all the employees having the specified push-button encoding. See Fig. 7.80.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 7