nhu313 c0dbca2feb Update 'README.md' | 6 gadus atpakaļ | |
---|---|---|
src | 6 gadus atpakaļ | |
.gitignore | 6 gadus atpakaļ | |
PhoneBookUML.png | 6 gadus atpakaļ | |
README.md | 6 gadus atpakaļ | |
pom.xml | 6 gadus atpakaļ |
PhoneBook
classPhoneBook
class that holds names and phone numbers.Hint: You should use a sorted map.
Your PhoneBook class should have the following method
add(String name, String phoneNumber)
remove(String name)
lookup(String name)
name
reverseLookup(String phoneNumber)
phoneNumber
toString()
Format should be [name] [phone number]
Sample Script
PhoneBook phoneBook = new PhoneBook();
phoneBook.add("Zebra", "111-222-333");
phoneBook.add("Dog", "222-444-4444");
phoneBook.display();
Dog 222-444-4444
Zebra 111-222-333
PhoneBook
class to map names to lists of phone numbers.add()
and remove()
methods to handle adding or removing individual numbersremoveRecord
method for removing an entire entry from your PhoneBook.