chu1ta26 e1ba262d58 Update 'README.md' | 6 anni fa | |
---|---|---|
.idea | 6 anni fa | |
src/test/java/com/zipcodewilmington/phonebook | 6 anni fa | |
.gitignore | 6 anni fa | |
PhoneBook.java | 6 anni fa | |
PhoneBookTest.java | 6 anni fa | |
PhoneBookUML.png | 6 anni fa | |
README.TXT | 6 anni fa | |
README.md | 6 anni fa | |
package.bluej | 6 anni fa | |
phonebook.iml | 6 anni fa | |
pom.xml | 6 anni fa |
<<<<<<< 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.