Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

?. The ContactManager maintains an array of contacts and provide a few methods,

ID: 3703867 • Letter: #

Question

?. The ContactManager maintains an array of contacts and provide a few methods, including the the following class model the method to add a contact to the array. See the following class model ContactManager -Contactl contacts -int nContacts +ContactManager(int maxContacts) +boolean addContact(String firstName, String lastName, String middleName, String phoneNumber) tint countContacts0 +int countEqualContacts (Contact c) · In the model, the top box is the name of the class The middle box lists the instance variables of the class. The" before a variable type means that the variable should be declared as private. “+" means public. In this assignment, all instance variables will be declared private. nContacts is used to have the current number of contacts added to the array. Note that it is not the array size The bottom box lists the methods that have to be implemented in the class. As shown in the model, a constructor and three methods have to be implemented in the ContactManager class. See ContactManager.java for the details of individual methods.

Explanation / Answer

public class ContactManager { private Contact[] contacts; private int nContacts; public ContactManager(int nMaxContact) { contacts = new Contact[nMaxContact]; this.nContacts = nMaxContact; } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote