You are to adapt the code that you developed in Assignment 3 to produce an interface that reads the myContactsList.db file and displays it and allows for a number of actions.
The record that you wrote to myContactsList.db has the following structure:
struct contact {
unsigned long phone_number;
long first_name_posn;
long last_name_posn;
long company_name_posn;
long email_posn;
long next;
};
Changes to the original Assignment 3 code:
Your interface will allow the following to be done:
1. List all contacts in alphabetical (ascending) order by name (either last name or company name) only displaying the name. Only 5 names will be displayed at a time. You can tell the interface to scroll down or up one name at a time.
2. Add a new contact.
3. Allow one of the contacts to be selected (by the number beside it on the display).
4. Display the full information for the selected contact.
5. Change the phone number or email for a selected contact.
6. Delete a selected contact.
7. Return to the full contacts list.
8. Exit the program (all changes to the myContactsList.db file must be written to disk).
The full contacts list interface is as follows:
Number of Contacts = 20
A
1. Aberfoyle Mill
2. Air Canada
3. Jason Argonaut
B
4. Terry Bernard
5. Bombay Café
The action inputs are the following:
+ Move down one name
- Move up one name
Number Select this contact and display its full information
A Add a new contact
X Exit the program
The following pages will introduce the three different interfaces
1. Full Contacts List
2. Contact Information Display
3. Contact Information Edit and Add
Number of Contacts = 20
A
1. Aberfoyle Mill
2. Air Canada
3. Jason Argonaut
B
4. Terry Bernard
5. Bombay Café
Action: +
Number of Contacts = 20
A
2. Air Canada
3. Jason Argonaut
B
4. Terry Bernard
5. Bombay Café
6. Ivy Breezie
Action: +
Number of Contacts = 20
A
3. Jason Argonaut
B
4. Terry Bernard
5. Bombay Café
6. Ivy Breezie
C
7. Barbara Catena
Action: -
Number of Contacts = 20
A
2. Air Canada
3. Jason Argonaut
B
4. Terry Bernard
5. Bombay Café
6. Ivy Breezie
Action: 5
Contact #5
First Name:
Last Name:
Company Name: Bombay Cafe
Phone Number: 5198373899
Email: bcafe@gmail.com
Action: E
R Return to the Full Contacts List interface
E Edit this contact
D Delete this contact and return to Full Contacts List
Contact #5
First Name:
Last Name:
Company Name: Bombay Cafe
Phone Number (enter only numbers): 5198362788
Email: bombaycafe@gmail.com
Action: S
Number of Contacts = 20
A
2. Air Canada
3. Jason Argonaut
B
4. Terry Bernard
5. Bombay Café
6. Ivy Breezie
Action: A
Contact #8
First Name: Peg
Last Name: Balasheta
Company Name:
Phone Number (enter only numbers): 6733860
Email: peg@balasheta.org
Action: S
Number of Contacts = 21
A
2. Air Canada
3. Jason Argonaut
B
4. Peg Balashata
5. Terry Bernardo
6. Bombay Cafe
Action: X
R Return to the Full Contacts List interface
(do not update contact record)
S Save this contact and return to Full
Contacts List
D Delete this contact and return to Full
Contacts List
R Return to the Full Contacts List interface
(do not update contact record)
S Save this contact and return to Full
Contacts List