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