write a program that will maintain a phone directory using linked list
Posted on 2006-03-22
Write a program that will maintain a phone directory. Your program should be able to process several commands as explained later in this assignment.
This program will emphasize the use of linked lists. Following are the various steps involved in completing this assignment:
1. All phone entries will be maintained in a sorted order by the last name. Further, the entries for a given last name will have to be maintained in a sorted order by the first name.
2. Your program has to process various commands from a file named phone.in. A command will be specified on a line by itself. Further, there will be a blank line between two commands. The various commands and the file format is as specified below:
 Add an entry to the phone directory (NOTE: The phone numbers in the directory have to be unique)
 Print entries by last name
 Delete an entry by a given phone number
 Delete all entries with the given last name
 Print entire directory (output should be sorted as mentioned above)
A sample input file with each of the above commands might look like this (it is recommended you make one up yourself to test your program exhaustively – with all possible cases)
8712 Birch Ln
1055 Conell St
3. The output of your program has to be written to an output file, phone.out
4. The executable of your program has to be called phone.
5. Your program has to be split into several appropriate functions. Further, you need to use descriptive variable names. The style and readability of your program will also determine your grade, in addition to the correctness of the program.
6. Files needed for this program: defs.h, llist.h, llist.c, phone.h, phone.c, phoneFns.c Makefile