Question: Assignment Phone Book PROGRAM PARTICULARS Your program will mimic a phone book. You will be given a file. In the file is a set of
Assignment Phone Book
PROGRAM PARTICULARS
Your program will mimic a phone book. You will be given a file. In the file is a set of names and phone numbers (an entry). There will be one item per line (field), 3 items per entry(record), you dont know how many records are in the file. You are guaranteed at least one record.
Your program will be menu driven.
Your task is to accept a last name, a first name or a phone number from the user and to read through the text file, looking for a match. If match(s) are found, display the information, and then redisplay the menu.
If the entry was not found display the appropriate not found message. All search results will be written to the screen. You are guaranteed that when you ask for input you will get the appropriate type not necessarily within range but the right type.
INPUT FILE FORMAT
The input file will contain records. There will be one field per line, all lines in the file end with a carriage return. Here is a sample input file for clarification:
Mason
Athena
509-359-4293
Rogers
Steve
509-359-6260
Nielsen
Eric
509-359-6907
Nielsen
Jade
509-359-2314
Karrier
Marco
509-359-6809 # This is not the entire file.
SAMPLE OUTPUT
My Contacts File Program
Please choose from the following options:
1. Look up contact by last name
2. Look up contact by first name
3. Look up contact by phone number
0. QUIT
Enter a choice: 1
Please enter the last name you would like to search for: nielsen
Eric
Nielsen
509-359-6907
Jade
Nielsen
509-359-2314
My Contacts File Program
Please choose from the following options:
1. Look up contact by last name
2. Look up contact by first name
3. Look up contact by phone number
0. QUIT
Enter a choice: 1
Please enter the last name you would like to search for: lemelin
No Entry Found.
My Contacts File Program
Please choose from the following options:
1. Look up contact by last name
2. Look up contact by first name
3. Look up contact by phone number
0. QUIT
Enter a choice: 2
First name lookup: eric
Eric
Nielsen
509-359-6907
My Contacts File Program
Please choose from the following options:
1. Look up contact by last name
2. Look up contact by first name
3. Look up contact by phone number
0. QUIT
Enter a choice: 0
Thanks for using the CSCD 110 white page
>>>
PROGRAM SPECIFICS
The official input file name for this program is entries.txt.
Extra Credit (5 points each)
Read the file only once and store the information in list. On subsequent searches, iterate through the (list) and search.
Define functions with Doc Strings.
Error Check on Menu input.
Exception Handling.
Be sure to declare any extra credit attempted.
TURN IN:
Via canvas.ewu.edu system in lastname_firstinitial_phone.py format. Do not zip your file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
