Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Object-oriented programming //JAVA image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions