Phone-book

Start from ready-to-use Eclipse project PhonebookProject.zip (follow the instructions)

Design and implement a Java application to manage a phone-book containing contacts. Each contact is identified by first name, last name, and phone number.

When the phone-book is created, it is associated to a name, which can be obtained through the getName() method.

A new contact is added by means of the add() method, receiving three parameters: first name, last name, and phone number.

The first contact of the phone book can be accessed through the first() method, returning a string representation of the contact (i.e., first name, last name, and phone number separated by a white space).

Each contact is identified by its position in the list, according to insertion order. Therefore, contacts can be obtained by means of the get() method, which accepts one parameter (the requested index) and returns a textual representation of the entry (same format as previous method). Note that and indexes start at 1, i.e., first() == get(1).

The whole phone-book can be converted to a string by means of toString() method. The resulting string concatenates the textual representation of each contact, separated by commas. The list of contacts is delimited by parentheses.

Finally, find() method returns the textual representation of first-found contact in the phone-book, which contains the searched parameter in either first name, or last name, or phone number.