Question: java programming Java- Basic Algorithm - Address Book Lookup You are asked to implement an AddressBook class with 2 methods: add() and queryAddress(). The add)
java programming

Java- Basic Algorithm - Address Book Lookup You are asked to implement an AddressBook class with 2 methods: add() and queryAddress(). The add) method adds a name and email address pair to the address book. If the name already exists, the email address is added to the list of email addresses for that person. The queryAddress() method returns the list of email address(es) associated with a name in ascending order You do not have to read input or write output. The code in the locked portion of the editor will 1. read an integer, n, denoting the number of entries in the address book, 2. read n pairs of names and email addresses, 3. read a string representing the name to look up in the address book, and 4 print the email address(es) returned by your queryAddress) method. Sample Input Greg greg123@gmail.com Jane jane@yahoo.com Jane jane@gmail.com Jane Sample Output jane@gmail.com jane@yahoo.com
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
