Question: You will be building an ArrayList to represent a phone book. (1) Complete the following two files PhoneBookEntryjava -Class definition PhoneBook java- Contains main method

 You will be building an ArrayList to represent a phone book.(1) Complete the following two files PhoneBookEntryjava -Class definition PhoneBook java- Containsmain method (2) Complete the PhoneBookEntry class per the following specifications Privatefields o String name String phoneNumber Constructor with name and phoneNumber asparameters (in that order) Public member methods o getName0-Accessor o getPhoneNumberO-Accessor osetPhoneNumber(String number) -Mutator Ex of printphoneBbookEntry output Name: Roxanne Hughes Phone number:443-555-2864

You will be building an ArrayList to represent a phone book. (1) Complete the following two files PhoneBookEntryjava -Class definition PhoneBook java- Contains main method (2) Complete the PhoneBookEntry class per the following specifications Private fields o String name String phoneNumber Constructor with name and phoneNumber as parameters (in that order) Public member methods o getName0-Accessor o getPhoneNumberO-Accessor o setPhoneNumber(String number) -Mutator Ex of printphoneBbookEntry output Name: Roxanne Hughes Phone number:443-555-2864 (3) Complete the PhoneBook class per the following specifications: Private field o ArrayList list Default constructor Public member methods o getEntry String name) addEntry(String name, String number) o removeEntry(String name) editEntry (String name, String number) lookUpPhoneNumber (String name) printBook0 (4) In main0 method . prompt the user for three phone book entries and add them to the list. EX Entry 1: Enter name: Roxanne Hughes Enter phone number: 443-555-2864 Entry 2 Enter name: Juan Alberto Jr Enter phone number: 10-555-9385 Entry 3: Enter name: Rachel Phillips Enter phone number: 10-555-6610 Output the list Ex Phone Book Name: Roxanne Hughes Phone number: 443-555-2864 Name: Juan Alberto Jr Phone number: 410-555-9385 Name: Rachel Phillips Phone number: 310-555-6610 Call the proper method to look up the phone number for Roxanne Hughes Call the proper method to update Roxanne Hughes' phone number. Call the proper method to remove the entry of Juan Alberto Jr. Output the list again. Ex Phone Book Name: Roxanne Hughes Phone number: 443-555-1234 Name: Rachel Phillips Phone number: 310-555-6610 Load default template... Current file: PhoneBookEntry.java 1 public class PhoneBookEntry { 2 /*FIXME(1) Define two fields: name and phoneNumber. 3 Both fields are of String type*/ 4 6 /*FIXME(2) Define a consructor that takes two argument: name, phoneNumber. 7 Parameters are name followed by phone number.* 10 *FIXME(3) Define a getter method for the name field*/ 12 13 14 *FIXMEC4 Define a getter method for the phoneNumber field*/ 15 16 17 /*FIXMEC5) Define a setter method for the phoneNumber field*/ 18 19 20 public void printPhoneBookEntryO 21 System.out.println("Name:"name); System.out.println("Phone Number:"phoneNumber) 23 24 25 Current file: PhoneBook.java Load default template... 1 import java.util.ArrayList; 2 import java.util.Scanner 4 public class PhoneBook 6 /*FIXMEC1) Define one field: list, which is an ArrayList of PhoneBookEntry* 7 9 public PhoneBook) 10 list -new ArrayListO 12 13This method searches list for the PhoneBookEntry with a given name value. 14 Note that this is an exhaustive search which is a very bad practice. We will 15improve this method in the future after we learn sorting and search algorithms 16 17 public PhoneBookEntry getEntry(String name) 18 19 20 21 PhoneBookEntry entry null; for(int i 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!