Stwillia94 6e60ee3ffa mostly complete | 6 лет назад | |
---|---|---|
src | 6 лет назад | |
.gitignore | 6 лет назад | |
PhoneBookUML.png | 6 лет назад | |
README.md | 6 лет назад | |
pom.xml | 6 лет назад |
PhoneBook
classPhoneBook
classIn this diagram, C stands for Class, f stands for field, and m stands for method. So, it can give you a specification for the class and the things it needs to do.
PhoneBook
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)
lookup(String name)
name
remove(String name)
reverseLookup(String phoneNumber)
phoneNumber
listNamesAndNumbers()
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.listNamesAndNumbers();
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.