A sequential access file "phonebook.txt" has 10 records, which contains
FIRST NAME, LAST NAME, and PHONE NUMBER of a person.
Write a C MAIN function to accomplish the following tasks.
• . Declare an array of structures A which will hold the records of "phonebook.txt" file.
• . Store "phonebook.txt" file into the array of structures A.
• . Search the array of structures A for a particular FIRST and LAST NAME of a person which will be read from the standard input.
• . If the search is succesful, it will print FIRST NAME, LAST NAME and PHONE NUMBER of the person being searched, otherwise, it will print "NOT FOUND".
Create an input file "phonebook" with at least 10 records to test the program.
A sample record of "phonebook.txt" file may contain the data fields as shown below:
FIRST NAME LAST NAME PHONE NO
XXXXXXXXX xxxxxxxx 12345678
Also the struct part of the program can be be:
struct phonebook{
char firstname[15];
char lastname[15];
char phone[15];
} A[10];
1
Expert's answer
2013-05-21T10:47:43-0400
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Comments
Leave a comment