CS3340:  Intro OOP and Design

Exercise - Classes
due: Oct. 4, start of class

 

Extend your previous exercise application AddressBookApplication. so that contains an instance of a class AddressBook. The AddressBook class holds a collection of objects of the class AddressEntry. An AddressEntry represent a single contact in your AddressBook. Look at the requirements of Project 1 (as this exercise can help you with this). Think forward to the requirements of Project 1 to consider what kind of data structure you might used for your collection of AddressEntry objects so that you efficiently - load from file, list in alphabetic order, search/find, add and remove.

Note: this work can help you with your Project 1 requirements.

 

  • In the main method of AddressBookApplication you are to create an instance of AddressBook (call it ab).
  • NEXT, you are to create a method in your AddressBookApplication called void initAddressBookExercise(ab) that creates 2 instances of AddressEntry and places them in ab (an AddressBook) collection called AddressEntryList. NEXT, the initAddressBookExercise method it calls the AddressBook's ab.list() method.
  • NOTE: The AddressBook's list() method cycles through the collection of AddresEntry objects using an iterator the contained in AddressBook and print outs the information to the console window calling toString() methods on each of its AddressEntry objects.
  • Note: AddressEntry class must have a String toString() method that takes all of its data elements and composes a nicely formated string from its values and returns this string. Again refer to Project 1.

Basically you will be implementing these Parts of the UML classes from Project 1

 

 

Deliverables

Demonstrate to fellow class mate and sign the sheet ---if you did not succeed this is your SAFTEY check to get help from instructor or make appointment if no time in class if you could not complete --you WILL be required to do this for your project. Note: I won't give you points back --ideally you come and see me for help before the exercise is due.

 

© Lynne Grewe