For this project, you will write a resizeable ArrayList class entitled "ContactsArrayList".

Note that to get practice with algorithm development, we will not use the predefined class ArrayList. We will have to do extra work in order not to use that class since we will have to make sure we are not adding duplicate Contacts and we will have to resize the array if it gets full.

We will simplify the project to work with one data type: class Contact. Class Contact will contain several elements: a uniquely assigned number (starting at 1), name, picture, and comment. The picture entry will be a string with the file name of the picture to be displayed with the Contact. The class should have a parameterized constructor to accept these values. Class ContactsArrayList will be based upon an array of class Contact. The initial array will be of length 1. When a new Contact is to be added, the program will determine if it already exists and report to the console if it does, or add the Contact if it does not. The addition is a duplicate if the current Contact name (case insensitive) is already an entry in the list.

If the current array is full, a new array will be created and the existing items will be copied to it. The program should have capabilities to draw the current list of Contacts in a JFrame, add a contact and redraw, and delete a Contact and redraw. To delete a Contact, specify the Contact number. Do not use the ArrayCopy capability as part of the addition/deletion operations.

Also, the program must be able to sort the Contacts and redraw the sorted list when you do. You must implement your own sorting routine. You may not use any predefined sorting capabilities.

When the project runs:

The program have minimal interaction with the user. When it runs the program should do the following:

1. create 5 contacts: Mick, Keith, Bill, Charlie, and Brian. They should show in a window.

3. Sort the contacts. They should rearrange in the window

4. Delete Brian (updated list without Brian should show)

5. Add Keith (this step should fail with an error message to the console).

6. Add MickTaylor. (updated list with MickTaylor should show)

7. Quit the program

You must implement a JButton to be clicked in order to advance to the next event.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.