CIS-180 Laboratory Project

Contact Editor Implementation (Part 2)

Objectives

Your contact editor should provide an option for the user to save the changes to a contact. For example, you might have a button or a menu item that the user can select to save the changes to a contact.

The main task for today's lab is to complete the contact editor class. However, in order to test your implementation, you will need some way to examine the fields of a contact to check that they have been updated correctly. For this purpose, you should also add a print method to your contact (not contact editor) class to print the contact information on the console.

Exercises

In the following exercises, the classes discussed above will be referred to as Contact and ContactEditor, although it is fine if you have used different names.

As you complete each exercise, make sure that your feature list and design documents (e.g. UML class diagrams) are kept consistent with what you have done.

  1. If you haven't already done so, complete the exercises from last week's lab.
  2. Add the print method to your Contact class.
  3. Modify your main method to test the print method by sending a print message to a contact object you have created.
  4. Add code to your ContactEditor class to implement saving changes to a contact. The details depend somewhat on your user interface.
  5. Add a line of code to your ContactEditor class to send a print message to a contact after it is updated, and test to make sure your contact editor is working properly.
  6. When you are convinced that your contact editor is working correctly, you can remove (or comment out) the line of code added above for testing.