CHU1TA26 1778fc8120 Merge branch 'master' of https://git.zipcode.rocks/chu1ta26/ZCW-PhoneBook | 6 lat temu | |
---|---|---|
.idea | 6 lat temu | |
src/test/java/com/zipcodewilmington/phonebook | 6 lat temu | |
.gitignore | 6 lat temu | |
PhoneBook.java | 6 lat temu | |
PhoneBookTest.java | 6 lat temu | |
PhoneBookUML.png | 6 lat temu | |
README.TXT | 6 lat temu | |
README.md | 6 lat temu | |
package.bluej | 6 lat temu | |
phonebook.iml | 6 lat temu | |
pom.xml | 6 lat temu |
<<<<<<< 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.