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