Develop a telephone directory which is capable of doing the following:
- Insert a contact
- Delete a contact
- Edit an existing contact (changing or modifying a record)
- Search a contact (and display complete record on screen)
a. Search through first name
b. Search through last name
c. Search through landline
d. Search through cell number
Display all contacts that:
a. Start with a given letter (e.g., all contacts starting with ‘M’)
b. Landline or cell number starting with a particular pattern (e.g., 0300 for cell number, or
(042)3518 for landline number)
Sort all contacts with respect to
a. first name
b. last name
c. land line number
d. mobile number
All the contacts are to be stored in a file, contacts.dat (all records are sorted with respected to first
name). You have to update the existing file if a contact is inserted, deleted or edited. If searching is
applied, the record(s) should be displayed on the output screen only. In case of sorting, new file
should be created (the name of the new file should be entered by the program user). Note that all
fields of a single record are comma separated (no commas otherwise). You are not allowed to use
data type string in any case. Make separate functions to perform each task. Inputs are to be taken in
the main function only; cin cannot be used in any function other than main.
Your program should be menu driven. The program should exit if the user choice is 7.
A sample record will be as follows:
1. An address may include comma too, e.g. 123-H1, Johar Town, Lahore.
2. A cell phone number will only start with a 0.
3. Middle name cannot be entered in the record.
4. All entries will have first name, last name, address, cell phone and landline, none of the entry
can be skipped.
5. Maximum number of records can be 1000.
6. Maximum number of characters (FirstName) should not exceed 15 characters.
7. Maximum number of characters (LastName) should not exceed 15.
8. Maximum number of characters (Address) should not exceed 30.