Question: Object-oriented programming //JAVA Write an AddressBook class that manages a collection of Person objects. An AddressBook object will allow the programmer to add, delete, or











Write an AddressBook class that manages a collection of Person objects. An AddressBook object will allow the programmer to add, delete, or search for a Person object in the address book. Development Steps We will develop this program in five steps: 1. Implement the constructor(s). 2. Implement the add method. 3. Implement the search method. 4. Implement the delete method. 5. Finalize the class. JAVA Step 1 Design - Start the class definition with two constructors - The zero-argument constructor will create an array of default size - The one-argument constructor will create an array of the specified size Program source file is too big to list here. From now on, we ask you to view the source files using your Java IDE. Directory: Source Files: AddressBook.java The purpose of Step 1 testing is to verify that the constructors work as expected. - Design and implement the add method - The array we use internal to the AddressBook class has a size limit, so we need consider the overflow situation - Alternative 1: Disallow adds when the capacity limit is reached - Alternative 2: Create a new array of bigger size - We will adopt Alternative 2 he purpose of Step 2 test is to confirm that objects are added orrectly and the creation of a bigger array takes place when an verflow situation occurs. Design and implement the search method. - To test the correct operation of the search method, we need to carry out test routines much more elaborate than previous tests. Design and implement the delete method. Final Test - Since the three operations of add, delete, and search are interrelated, it is critical to test these operations together. We try out various combinations of add, delete, and search operations. Since we are designing a single class, our task is to identify the public methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
