wulawrence 22c06e7a2e Merge dfc60d5595ebcf7ca501c3b60a3b928aa2b31064 into 74a9673e36c7d25c28315cb54247a91792f8fbc0 | vor 6 Jahren | |
---|---|---|
src | vor 6 Jahren | |
.gitignore | vor 6 Jahren | |
PhoneBookUML.png | vor 6 Jahren | |
README.md | vor 6 Jahren | |
pom.xml | vor 6 Jahren |
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
display()
print a human-readable list of all entries (names and phone numbers) in alphabetical order.
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.