Bläddra i källkod

edited readmes

Leon 6 år sedan
förälder
incheckning
dda7744094

+ 12
- 0
README-NumberUtilities.md Visa fil

@@ -1,4 +1,16 @@
1 1
 # NumberUtilities
2
+* Ensure each of the test cases in the class [NumberUtilitiesTest]() successfully passes upon completion of each method stubs in the class [NumberUtilities]().
3
+    * `String getEvenNumbers(int start, int stop)` 
4
+    * `String getOddNumbers(int start, int stop)`
5
+    * `String getSquareNumbers(int start, int stop, int step)` 
6
+    * `String getRange(int start, int stop, int step)` 
7
+    * `String getExponentiations(int start, int stop, int step, int exponent)` 
8
+    
9
+
10
+
11
+
12
+
13
+
2 14
 
3 15
 ## `String getRange(int stop)`
4 16
 * **Description**

+ 187
- 13
README-TableUtilities.md Visa fil

@@ -1,8 +1,183 @@
1 1
 # TableUtilities
2
+* Ensure each of the test cases in the class [TableUtilitiesTest]() successfully passes upon completion of each method stubs in the class [TableUtilities]().
3
+    * `String getLargeMultiplicationTable()`
4
+    * `String getSmallMultiplicationTable()`
5
+    * `String getMultiplicationTable(int width)`
2 6
 
3
-## `String tableSquare(int n)`
7
+
8
+
9
+
10
+    
11
+    
12
+    
13
+    
14
+    
15
+    
16
+    
17
+    
18
+    
19
+    
20
+    
21
+    
22
+    
23
+    
24
+    
25
+    
26
+    
27
+    
28
+    
29
+    
30
+    
31
+    
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+## `String getSmallMultiplicationTable()`
40
+* **Description**
41
+    * Generate a `String` representation of a multiplication table whose dimensions are `4` by `4`
42
+	
43
+### Example 1
44
+* Sample Script
45
+
46
+    ```
47
+    // : Given    
48
+    // : When
49
+    String outcome = TableUtilities.getSmallMultiplicationTable();
50
+    
51
+    // : Then
52
+    System.out.println(outcome);
53
+    ```
54
+
55
+
56
+
57
+* Sample Output
58
+
59
+    ```
60
+      1 |  2 |  3 |  4 |
61
+      2 |  4 |  6 |  8 |
62
+      3 |  6 |  9 | 12 |
63
+      4 |  8 | 12 | 16 |
64
+    ```
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+    
73
+    
74
+    
75
+    
76
+    
77
+    
78
+    
79
+    
80
+    
81
+    
82
+    
83
+    
84
+    
85
+    
86
+    
87
+    
88
+    
89
+    
90
+    
91
+    
92
+    
93
+    
94
+    
95
+    
96
+    
97
+    
98
+    
99
+    
100
+    
101
+    
102
+    
103
+    
104
+    
105
+
106
+## `String getLargeMultiplicationTable()`
107
+* **Description**
108
+    * Given one integer, `width`, generate a `String` representation of a multiplication table whose dimensions are `width` by `width`
109
+
110
+	
111
+### Example
112
+* Sample Script
113
+
114
+    ```
115
+    // : Given
116
+    int n = 3;
117
+    
118
+    // : When
119
+    String outcome = Tables.getLargeMultiplicationTable();
120
+    
121
+    // : Then
122
+    System.out.println(outcome);
123
+    ```
124
+
125
+
126
+
127
+* Sample Output
128
+
129
+    ```
130
+    1 |  2 |  3 |  4 |  5 |  6 |  7 |  8 |  9 | 10 |
131
+    2 |  4 |  6 |  8 | 10 | 12 | 14 | 16 | 18 | 20 |
132
+    3 |  6 |  9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
133
+    4 |  8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 |
134
+    5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 |
135
+    6 | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
136
+    7 | 14 | 21 | 28 | 35 | 42 | 49 | 56 | 63 | 70 |
137
+    8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 |
138
+    9 | 18 | 27 | 36 | 45 | 54 | 63 | 72 | 81 | 90 |
139
+   10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 |100 |
140
+   
141
+    ```
142
+    
143
+    
144
+    
145
+    
146
+    
147
+    
148
+    
149
+    
150
+    
151
+    
152
+    
153
+    
154
+    
155
+    
156
+    
157
+    
158
+    
159
+    
160
+    
161
+    
162
+    
163
+    
164
+    
165
+    
166
+    
167
+    
168
+    
169
+    
170
+    
171
+    
172
+    
173
+    
174
+    
175
+    
176
+    
177
+    
178
+## `String getMultiplicationTable(int width)`
4 179
 * **Description**
5
-    * Given one integer, `n`, generate a `String` representation of a multiplication table whose dimensions are `n` by `n`
180
+    * Given one integer, `width`, generate a `String` representation of a multiplication table whose dimensions are `width` by `width`
6 181
 
7 182
 	
8 183
 ### Example 1
@@ -10,7 +185,7 @@
10 185
 
11 186
     ```
12 187
     // : Given
13
-    int n = 4;
188
+    int n = 3;
14 189
     
15 190
     // : When
16 191
     String outcome = Tables.getMultiplicationTable(n);
@@ -24,10 +199,9 @@
24 199
 * Sample Output
25 200
 
26 201
     ```
27
-    |  1 |  2 |  3 |  4 |
28
-    |  2 |  4 |  6 |  8 |
29
-    |  3 |  6 |  9 | 12 |
30
-    |  4 |  8 | 12 | 16 |
202
+      1 |  2 |  3 |
203
+      2 |  4 |  6 |
204
+      3 |  6 |  9 |
31 205
     ```
32 206
 
33 207
 
@@ -51,10 +225,10 @@
51 225
 * Sample Output
52 226
 
53 227
     ```
54
-    | 1 |  2 |  3 |  4 |  5 |  6 |
55
-    | 2 |  4 |  6 |  8 | 10 | 12 |
56
-    | 3 |  6 |  9 | 12 | 15 | 18 |
57
-    | 4 |  8 | 12 | 16 | 20 | 24 |
58
-    | 5 | 10 | 15 | 20 | 25 | 30 |
59
-    | 6 | 12 | 18 | 24 | 30 | 36 |
228
+     1 |  2 |  3 |  4 |  5 |  6 |
229
+     2 |  4 |  6 |  8 | 10 | 12 |
230
+     3 |  6 |  9 | 12 | 15 | 18 |
231
+     4 |  8 | 12 | 16 | 20 | 24 |
232
+     5 | 10 | 15 | 20 | 25 | 30 |
233
+     6 | 12 | 18 | 24 | 30 | 36 |
60 234
     ```

+ 4
- 4
README.md Visa fil

@@ -1,8 +1,8 @@
1 1
 # ZCW-MicroLabs-Loops
2
-## 1) NumberUtilities
3
-## 2) TriangleUtilities
4
-## 3) TableUtilities
5
-
2
+* Read through each of the following `README` files and complete each of the asks.
3
+    * [README-NumberUtilities.md](./README-NumberUtilities.md)
4
+    * [README-TriangleUtilities.md](./README-NumberUtilities.md)
5
+    * [README-TableUtilities.md](./README-NumberUtilities.md)
6 6
 
7 7
 
8 8
 

+ 0
- 1
src/test/java/io/zipcoder/microlabs/mastering_loops/TableUtilitiesTest.java Visa fil

@@ -62,7 +62,6 @@ public class TableUtilitiesTest {
62 62
                 " 18 | 36 | 54 | 72 | 90 |108 |126 |144 |162 |180 |198 |216 |234 |252 |270 |288 |306 |324 |342 |360 |\n" +
63 63
                 " 19 | 38 | 57 | 76 | 95 |114 |133 |152 |171 |190 |209 |228 |247 |266 |285 |304 |323 |342 |361 |380 |\n" +
64 64
                 " 20 | 40 | 60 | 80 |100 |120 |140 |160 |180 |200 |220 |240 |260 |280 |300 |320 |340 |360 |380 |400 |\n";
65
-
66 65
         String actual = TableUtilities.getMultiplicationTable(20);
67 66
         Assert.assertEquals(expected, actual);
68 67
     }

Binär
target/classes/io/zipcoder/microlabs/mastering_loops/MainApp.class Visa fil


Binär
target/classes/io/zipcoder/microlabs/mastering_loops/TableUtilities.class Visa fil


Binär
target/classes/io/zipcoder/microlabs/mastering_loops/TriangleUtilities.class Visa fil


Binär
target/test-classes/io/zipcoder/microlabs/mastering_loops/TableUtilitiesTest.class Visa fil