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