chu1ta26 e1ba262d58 Update 'README.md' | пре 6 година | |
---|---|---|
.idea | пре 6 година | |
src/test/java/com/zipcodewilmington/phonebook | пре 6 година | |
.gitignore | пре 6 година | |
PhoneBook.java | пре 6 година | |
PhoneBookTest.java | пре 6 година | |
PhoneBookUML.png | пре 6 година | |
README.TXT | пре 6 година | |
README.md | пре 6 година | |
package.bluej | пре 6 година | |
phonebook.iml | пре 6 година | |
pom.xml | пре 6 година |
<<<<<<< HEAD
======= *
Write the classes needed to implement a very simple PhoneBook.
PhoneBook
class<<<<<<< HEAD
PhoneBook
class=======
In 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 from the java standard library.
Your PhoneBook class should have the following method
add(String name, String phoneNumber)
lookup(String name)
name
remove(String name)
reverseLookup(String phoneNumber)
phoneNumber
<<<<<<< HEADlistNamesAndNumbers()
[name] [phone number]
=======
* `toString()`
* return a human-readable list of all entries (names and phone numbers) in alphabetical order.
* Sample Script
```java
PhoneBook phoneBook = new PhoneBook();
phoneBook.add("Zebra", "111-222-333");
phoneBook.add("Dog", "222-444-4444");
<<<<<<< HEAD
phoneBook.listNamesAndNumbers();
=======
String entries = phoneBook.toString();
System.out.println(entries);
```
* Sample Output
```
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.