Przeglądaj źródła

Update README.md

Git-Leon 6 lat temu
rodzic
commit
ee388e32f3
Brak konta powiązanego z e-mailem autora
1 zmienionych plików z 46 dodań i 34 usunięć
  1. 46
    34
      README.md

+ 46
- 34
README.md Wyświetl plik

@@ -1,48 +1,60 @@
1 1
 # Holding Objects Lab:
2 2
 
3
-Fork and clone this repository to complete your lab. Submit each part with a Pull Request for a separate branch.
3
+* Fork and clone this repository to complete your lab. Submit each part with a Pull Request for a separate branch.
4 4
 
5 5
 ## Unit Tests
6 6
 
7
-You are expected to write unit tests for your code. Be sure to write the tests before implementing the functionality being tested. Tests must be thorough and address all possible paths through each method.
7
+* You are expected to write unit tests for your code.
8
+* Be sure to write the tests before implementing the functionality being tested.
9
+* Tests must be thorough and address all possible paths through each method.
8 10
 
9 11
 ## Submission
10 12
 
11
-Your completed lab must be submitted via GitHub. Labs are not complete unless they include UML diagrams of all implemented classes, as well as unit tests for all features.
13
+* Your completed lab must be submitted via GitHub.
14
+* Labs are not complete unless they include UML diagrams of all implemented classes, as well as unit tests for all features.
12 15
 
13 16
 ## Instructions:
14 17
 
15
-### Part I:
16
-
17
-Create a PhoneBook class that holds names and phone numbers. You can use an associative data type (one which stores items as keys paired with values). (Hint: You should use a sorted map).
18
-
19
-Your PhoneBook class should have the following method
20
-	* lookup(String name) -  allows you to look up a person's phone number based on their name
21
-	* add(String name, String phoneNumber) - add entry
22
-	* remove(String name) - remove entry
23
-	* display() - list all entries (names an phone numbers) in alphabetical order
24
-
25
-   * Sample Script
26
-
27
-	   ```java
28
-	   PhoneBook phoneBook = new PhoneBook();
29
-	   phoneBook.add("Zebra", "111-222-333");
30
-	   phoneBook.add("Dog", "222-444-4444");
31
-	   phoneBook.display(); 
32
-	   ```
33
-
34
-   * Sample Output
35
-
36
-	   ```
37
-		Dog 222-444-4444
38
-		Zebra 111-222-333
39
-	   ```
18
+### Building a basic `PhoneBook` class
19
+
20
+* Create a `PhoneBook` class that holds names and phone numbers.
21
+* You can use an [associative data type](https://en.wikipedia.org/wiki/Associative_array) (one which stores items as keys paired with values).
22
+* **Hint:** You should use a sorted map.
23
+
24
+* Your PhoneBook class should have the following method
25
+
26
+	* `add(String name, String phoneNumber)`
27
+		* adds an entry to the composite associate data type
28
+	* `remove(String name)`
29
+		* removes an entry to the composite associate data type
30
+	* `lookup(String name)`
31
+		* returns a phone number for the respective input `name`
32
+
33
+	* `reverseLookup(String phoneNumber)`
34
+		* returns a name for the respective input `phoneNumber`
35
+	* `display()`
36
+		* print a human-readable list of all entries (names and phone numbers) in alphabetical order.
37
+
38
+	   * Sample Script
39
+	
40
+		   ```java
41
+		   PhoneBook phoneBook = new PhoneBook();
42
+		   phoneBook.add("Zebra", "111-222-333");
43
+		   phoneBook.add("Dog", "222-444-4444");
44
+		   phoneBook.display(); 
45
+		   ```
46
+	
47
+	   * Sample Output
48
+	
49
+		   ```
50
+			Dog 222-444-4444
51
+			Zebra 111-222-333
52
+		   ```
40 53
       
41 54
 
42
-### Part II:
43
-
44
-Add a `reverseLookup()` method to PhoneBook. This method should allow you to look up names by the phone number associated with them.
45
-
46
-### Part III: 
55
+### Implementing Many-PhoneNumbers-To-One-Person Relationship
47 56
 
48
-Some people have more than one phone number. Refactor your PhoneBook class to map names to lists of phone numbers. You should modify your add() and remove() methods to handle adding or removing individual numbers, and create a removeRecord method for removing an entire entry from your PhoneBook.
57
+* [Some people have more than one](https://en.wikipedia.org/wiki/One-to-many_(data_model)) phone number.
58
+* Refactor your `PhoneBook` class to map names to lists of phone numbers.
59
+* You should modify your `add()` and `remove()` methods to handle adding or removing individual numbers
60
+* Create a `removeRecord` method for removing an entire entry from your PhoneBook.