|
@@ -1,3 +1,5 @@
|
|
1
|
+package DanDoBetterDrills;
|
|
2
|
+
|
1
|
3
|
|
2
|
4
|
|
3
|
5
|
/**
|
|
@@ -11,7 +13,8 @@ public class MathUtilities {
|
11
|
13
|
* @return sum of `baseValue` and `difference`
|
12
|
14
|
*/
|
13
|
15
|
public Integer add(int baseValue, int difference) {
|
14
|
|
- return null;
|
|
16
|
+ int easyOne = baseValue + difference;
|
|
17
|
+ return easyOne;
|
15
|
18
|
}
|
16
|
19
|
|
17
|
20
|
/**
|
|
@@ -20,7 +23,8 @@ public class MathUtilities {
|
20
|
23
|
* @return sum of `baseValue` and `difference`
|
21
|
24
|
*/
|
22
|
25
|
public Long add(long baseValue, long difference) {
|
23
|
|
- return null;
|
|
26
|
+ long easyOne = baseValue + difference;
|
|
27
|
+ return easyOne;
|
24
|
28
|
}
|
25
|
29
|
|
26
|
30
|
/**
|
|
@@ -29,7 +33,8 @@ public class MathUtilities {
|
29
|
33
|
* @return sum of `baseValue` and `difference`
|
30
|
34
|
*/
|
31
|
35
|
public Short add(short baseValue, short difference) {
|
32
|
|
- return null;
|
|
36
|
+ short easyOne = (short)(baseValue + difference);
|
|
37
|
+ return easyOne;
|
33
|
38
|
}
|
34
|
39
|
|
35
|
40
|
/**
|
|
@@ -38,7 +43,8 @@ public class MathUtilities {
|
38
|
43
|
* @return sum of `baseValue` and `difference`
|
39
|
44
|
*/
|
40
|
45
|
public Byte add(byte baseValue, byte difference) {
|
41
|
|
- return null;
|
|
46
|
+ byte easyOne = (byte)(baseValue + difference);
|
|
47
|
+ return easyOne;
|
42
|
48
|
}
|
43
|
49
|
|
44
|
50
|
/**
|
|
@@ -47,7 +53,7 @@ public class MathUtilities {
|
47
|
53
|
* @return sum of `baseValue` and `difference`
|
48
|
54
|
*/
|
49
|
55
|
public Float add(float baseValue, float difference) {
|
50
|
|
- return null;
|
|
56
|
+ return baseValue + difference;
|
51
|
57
|
}
|
52
|
58
|
|
53
|
59
|
/**
|
|
@@ -56,7 +62,7 @@ public class MathUtilities {
|
56
|
62
|
* @return sum of `baseValue` and `difference`
|
57
|
63
|
*/
|
58
|
64
|
public Double add(double baseValue, double difference) {
|
59
|
|
- return null;
|
|
65
|
+ return baseValue + difference;
|
60
|
66
|
}
|
61
|
67
|
|
62
|
68
|
/**
|
|
@@ -65,7 +71,7 @@ public class MathUtilities {
|
65
|
71
|
* @return difference between `baseValue` and `difference`
|
66
|
72
|
*/
|
67
|
73
|
public Integer subtract(int baseValue, int difference) {
|
68
|
|
- return null;
|
|
74
|
+ return baseValue - difference;
|
69
|
75
|
}
|
70
|
76
|
|
71
|
77
|
/**
|
|
@@ -74,7 +80,7 @@ public class MathUtilities {
|
74
|
80
|
* @return difference between `baseValue` and `difference`
|
75
|
81
|
*/
|
76
|
82
|
public Long subtract(long baseValue, long difference) {
|
77
|
|
- return null;
|
|
83
|
+ return baseValue - difference;
|
78
|
84
|
}
|
79
|
85
|
|
80
|
86
|
/**
|
|
@@ -83,7 +89,8 @@ public class MathUtilities {
|
83
|
89
|
* @return difference between `baseValue` and `difference`
|
84
|
90
|
*/
|
85
|
91
|
public Short subtract(short baseValue, short difference) {
|
86
|
|
- return null;
|
|
92
|
+
|
|
93
|
+ return (short)(baseValue - difference);
|
87
|
94
|
}
|
88
|
95
|
|
89
|
96
|
/**
|
|
@@ -92,7 +99,7 @@ public class MathUtilities {
|
92
|
99
|
* @return difference between `baseValue` and `difference`
|
93
|
100
|
*/
|
94
|
101
|
public Byte subtract(byte baseValue, byte difference) {
|
95
|
|
- return null;
|
|
102
|
+ return (byte)(baseValue - difference);
|
96
|
103
|
}
|
97
|
104
|
|
98
|
105
|
/**
|
|
@@ -101,7 +108,7 @@ public class MathUtilities {
|
101
|
108
|
* @return difference between `baseValue` and `difference`
|
102
|
109
|
*/
|
103
|
110
|
public Float subtract(float baseValue, float difference) {
|
104
|
|
- return null;
|
|
111
|
+ return (float)(baseValue - difference);
|
105
|
112
|
}
|
106
|
113
|
|
107
|
114
|
/**
|
|
@@ -110,7 +117,7 @@ public class MathUtilities {
|
110
|
117
|
* @return difference between `baseValue` and `difference`
|
111
|
118
|
*/
|
112
|
119
|
public Double subtract(double baseValue, double difference) {
|
113
|
|
- return null;
|
|
120
|
+ return (double)(baseValue - difference);
|
114
|
121
|
}
|
115
|
122
|
|
116
|
123
|
|
|
@@ -120,7 +127,7 @@ public class MathUtilities {
|
120
|
127
|
* @return division of `dividend` by `divisor
|
121
|
128
|
*/
|
122
|
129
|
public Integer divide(int dividend, int divisor) {
|
123
|
|
- return null;
|
|
130
|
+ return dividend/divisor;
|
124
|
131
|
}
|
125
|
132
|
|
126
|
133
|
/**
|
|
@@ -129,7 +136,7 @@ public class MathUtilities {
|
129
|
136
|
* @return division of `dividend` by `divisor
|
130
|
137
|
*/
|
131
|
138
|
public Long divide(long dividend, long divisor) {
|
132
|
|
- return null;
|
|
139
|
+ return dividend/divisor;
|
133
|
140
|
}
|
134
|
141
|
|
135
|
142
|
/**
|
|
@@ -138,7 +145,7 @@ public class MathUtilities {
|
138
|
145
|
* @return division of `dividend` by `divisor
|
139
|
146
|
*/
|
140
|
147
|
public Short divide(short dividend, short divisor) {
|
141
|
|
- return null;
|
|
148
|
+ return (short)(dividend/divisor);
|
142
|
149
|
}
|
143
|
150
|
|
144
|
151
|
/**
|
|
@@ -147,7 +154,7 @@ public class MathUtilities {
|
147
|
154
|
* @return division of `dividend` by `divisor
|
148
|
155
|
*/
|
149
|
156
|
public Byte divide(byte dividend, byte divisor) {
|
150
|
|
- return null;
|
|
157
|
+ return (byte)(dividend/divisor);
|
151
|
158
|
}
|
152
|
159
|
|
153
|
160
|
/**
|
|
@@ -156,7 +163,7 @@ public class MathUtilities {
|
156
|
163
|
* @return division of `dividend` by `divisor
|
157
|
164
|
*/
|
158
|
165
|
public Float divide(float dividend, float divisor) {
|
159
|
|
- return null;
|
|
166
|
+ return dividend/divisor;
|
160
|
167
|
}
|
161
|
168
|
|
162
|
169
|
/**
|
|
@@ -165,7 +172,7 @@ public class MathUtilities {
|
165
|
172
|
* @return division of `dividend` by `divisor
|
166
|
173
|
*/
|
167
|
174
|
public Double divide(double dividend, double divisor) {
|
168
|
|
- return null;
|
|
175
|
+ return (double)(dividend/divisor);
|
169
|
176
|
}
|
170
|
177
|
|
171
|
178
|
|
|
@@ -175,7 +182,7 @@ public class MathUtilities {
|
175
|
182
|
* @return product of `multiplicand` by `multiplier`
|
176
|
183
|
*/
|
177
|
184
|
public Integer multiply(int multiplicand, int multiplier) {
|
178
|
|
- return null;
|
|
185
|
+ return multiplicand*multiplier;
|
179
|
186
|
}
|
180
|
187
|
|
181
|
188
|
/**
|
|
@@ -184,7 +191,7 @@ public class MathUtilities {
|
184
|
191
|
* @return product of `multiplicand` by `multiplier`
|
185
|
192
|
*/
|
186
|
193
|
public Long multiply(long multiplicand, long multiplier) {
|
187
|
|
- return null;
|
|
194
|
+ return multiplicand*multiplier;
|
188
|
195
|
}
|
189
|
196
|
|
190
|
197
|
/**
|
|
@@ -193,7 +200,7 @@ public class MathUtilities {
|
193
|
200
|
* @return product of `multiplicand` by `multiplier`
|
194
|
201
|
*/
|
195
|
202
|
public Short multiply(short multiplicand, short multiplier) {
|
196
|
|
- return null;
|
|
203
|
+ return (short)(multiplicand*multiplier);
|
197
|
204
|
}
|
198
|
205
|
/**
|
199
|
206
|
* @param multiplicand value to be multiplied
|
|
@@ -201,7 +208,7 @@ public class MathUtilities {
|
201
|
208
|
* @return product of `multiplicand` by `multiplier`
|
202
|
209
|
*/
|
203
|
210
|
public Byte multiply(byte multiplicand, byte multiplier) {
|
204
|
|
- return null;
|
|
211
|
+ return (byte)(multiplicand*multiplier);
|
205
|
212
|
}
|
206
|
213
|
|
207
|
214
|
/**
|
|
@@ -210,7 +217,7 @@ public class MathUtilities {
|
210
|
217
|
* @return product of `multiplicand` by `multiplier`
|
211
|
218
|
*/
|
212
|
219
|
public Float multiply(float multiplicand, float multiplier) {
|
213
|
|
- return null;
|
|
220
|
+ return (float)(multiplicand*multiplier);
|
214
|
221
|
}
|
215
|
222
|
|
216
|
223
|
/**
|
|
@@ -219,7 +226,7 @@ public class MathUtilities {
|
219
|
226
|
* @return product of `multiplicand` by `multiplier`
|
220
|
227
|
*/
|
221
|
228
|
public Double multiply(double multiplicand, double multiplier) {
|
222
|
|
- return null;
|
|
229
|
+ return (double)(multiplicand*multiplier);
|
223
|
230
|
}
|
224
|
231
|
|
225
|
232
|
|
|
@@ -227,14 +234,14 @@ public class MathUtilities {
|
227
|
234
|
* @return true
|
228
|
235
|
*/
|
229
|
236
|
public Boolean returnTrue() {
|
230
|
|
- return null;
|
|
237
|
+ return true;
|
231
|
238
|
}
|
232
|
239
|
|
233
|
240
|
/**
|
234
|
241
|
* @return false
|
235
|
242
|
*/
|
236
|
243
|
public Boolean returnFalse() {
|
237
|
|
- return null;
|
|
244
|
+ return false;
|
238
|
245
|
}
|
239
|
246
|
|
240
|
247
|
}
|