Question: Extend your previous exercise application Address BookApplication so that contains an instance of a class AddressBook. The AddressBook class holds a collection of objects of

Extend your previous exercise application Address BookApplication so that contains an instance of a class AddressBook. The AddressBook class holds a collection of objects of the class Address Entry An Address Entry represent a single contact in your Address Book 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 Address Entry 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 Address Book (call it ab) . NEXT, you are to create a method in your AddressBookApplication called void intAddressBookExercise ab) that creates 2 instances of AddressEntry and places them in ab (an Address Book) collection called Address EntryList. NEXT, the initAddressBookExercise method it calls the AddressBook's ab.list() method. . NOTE: The Address Book's list() method cycles through the collection of AddresEntry objects using an iterator the contained in Address Book and print out the information to the console window calling toString methods on each of its Address Entry 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 AdressEntry Address BookApplicaiton AddressBook address EntryList Adress Entry firstName: String lastName: String street: String city: String state: String zip : Integer phone: String email: String maino create instance of AddressBook I called addressbook and then call WinitAddress BookExercise/addressBook) initAddress BookExercise (ab) will first create 2 Minstance of Address Entry AND then add them to 1 ab using the add method. NEXT, it will call Lr ab. list listo Iliterate through address EntryList and for Weach item call to String & print it out add(address Entry # add new Address Entry It object to the Il address Entry List Address Entryo Address EntrychrstName.lastName street state.zip.phone email) toStringoString Menu setFirstName(firstName: String) getLastName): String getfirstName(): String setLastName(lastName : String): String setCity(city: String) getCity: String setState(state : String) getState: String setstreet(street String) getStreet String W FINISH ALL THE REST OF THE set and get" methods Warious Prompt Methods Extend your previous exercise application Address BookApplication so that it creates a new method void init(String filename) which reads in data from the specified file to initialize the collection of AddressEntry elements stored in the AddressBookApplication. This exercise can help you with Project 1 (please see Project 1 requirements to maximize the correlation). Modify your AddressBookApplication so that its main method invokes its init(filename) with this file. Note that there is NO assummed size to the file. It could contain 0 to MANY addresses and you should read and parse the data until the end of file. Also, the main method of AddressBookApplication after calling init(filename) should call the AddressBook's ist method you created in previous exersise so you can see the newly created AddressEntry objects info. Use a constructor for Address Entry that takes all of the read in data from an address to create an instance if you have not already created one. exampleffile: Bob Darrell 597 54th st Redwood Wa 89978 bobdarrellaol.com 337-987-9887 Harrison Davis sunset blvd oaksville Wa 66667 hdavis@yahoo.com 879-705 8762
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
