12 Aug In C Language
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, 3 items per entry, you don’t know how many lines are in the file. You are guaranteed at least one entry.
Your program will be menu driven.
Your task is to accept an index number, 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, including the index of the entrie(s) 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.
You must store each entry in a struct that contains three strings: one for the first name, one for last name and the third for a phone number. The structs will be collected into an array of that type.
INPUT FILE FORMAT
The input file will contain entries. There will be one item per line, all lines in the file end with a carriage return. Here is a sample input file for clarification:
Steiner Stuart 509-359-6260
Smith Brandon
509-359-6260
Roestel Stacey
509-359-6260
Capaul Tom
509-359-6260
Steiner Darren
509-888-7676
SAMPLE OUTPUT
My Contacts File Program
Please choose from the following:
1) Look up a contact by last name
2) Look up a contact by first name
3) Look up a contact by phone number
4) Look up a contact by index (zero-based)
5) Quit
Choice –> -3
I am sorry that is not a valid menu choice.
Please try again
Please choose from the following:
1) Look up a contact by last name
2) Look up a contact by first name
3) Look up a contact by phone number
4) Look up a contact by index (zero-based)
5) Quit
Choice –> 1
Please enter the name you would like to search for: steiner
The information for Steiner is:
Stuart Steiner
509-359-6260
Darren Steiner
509-888-7676
Please choose from the following:
1) Look up a contact by last name
2) Look up a contact by first name
3) Look up a contact by phone number
4) Look up a contact by index (zero-based)
5) Quit
Choice –> 1
Please enter the name you would like to search for: peters
The information for Peters is:
No entries found for that information;
Please choose from the following:
1) Look up a contact by last name
2) Look up a contact by first name
3) Look up a contact by phone number
4) Look up a contact by index (zero-based)
5) Quit
Choice –> 5
Thanks for using your CSCD255 white pages.
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.