Starting from:

$29

Assignment #4: Contacts List App

The Problem You are to adapt the code that you developed in Assignment 3 to produce an interface that reads the myContactList.db file and displays it and allows for a number of actions. The record that you wrote to myContactList.db has the following structure and has not changed: struct contact { unsigned long phone_number; long first_name_posn; long last_name_posn; long company_name_posn; long email_posn; long next; }; File reading and writing functionality should not change between A3 and A4 – a database written using A3 should function for A4. If your writing functionality didn’t work in A3 according to the specs, you should fix it to comply. Project structure should also not change between A3 and A4 – use the same structure provided for A3. Changes to the original Assignment 3 code: - You must enter either a Last Name or a Company Name for each contact (along with the already mandatory the phone number). Both is also acceptable. - You must check that the phone number has either 7 or 10 digits and is all numeric. - The email address, if entered, must have the following format: string@string.ccc (both the domain name and the TLD can be any length greater than 0) Your interface will allow the following to be done: 1. List all contacts in alphabetical (ascending) ordered by name (either last name or company name) – only displaying the name. The program will always attempt to sort by last name first, and if that doesn’t exist, company name. 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 myContactList.db file must be written to disk). Interface The “full contacts list” interface is as follows: Number of Contacts = 7 A 1. Aberfoyle Mill 2. Air Canada 3. Jason Argonaut B 4. Terry Bernard 5. Bombay Café 6. Ivy Breezie Z 7. Steve Zissou Action: The action inputs for the main contact display are the following: 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 Full Contacts List Number of Contacts = 7 A 1. Aberfoyle Mill 2. Air Canada 3. Jason Argonaut B 4. Terry Bernard 5. Bombay Café 6. Ivy Breezie Z 7. Steve Zissou Action: Number of Contacts = 7 A 1. Aberfoyle Mill 2. Air Canada 3. Jason Argonaut B 4. Terry Bernard 5. Bombay Café 6. Ivy Breezie Z 7. Steve Zissou Action: 5 Contact Information – Display Contact Information – Edit and Add Available Actions for Contact Display R Return to the Full Contacts List interface E Edit this contact D Delete this contact and return to Full Contacts List Available Actions for Edit 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 Available Actions for New Contact R Return to the Full Contacts List interface (do not update contact record) S Save this contact and return to Full Contacts List Contact #5 First Name: Last Name: Company Name: Bombay Cafe Phone Number: 5198373899 Email: bcafe@gmail.com Action: E 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 = 7 A 1. Aberfoyle Mill 2. Air Canada 3. Jason Argonaut B 4. Terry Bernard 5. Bombay Café 6. Ivy Breezie Z 7. Steve Zissou Action: A New Contact First Name: Peg Last Name: Balasheta Company Name: Phone Number (enter only numbers): 6733860 Email: peg@balasheta.org Action: S Number of Contacts = 8 A 1. Aberfoyle Mill 2. Air Canada 3. Jason Argonaut B 4. Peg Balasheta 5. Terry Bernard 6. Bombay Café 7. Ivy Breezie Z 8. Steve Zissou Action: X

More products