|
@@ -11,7 +11,7 @@ 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
|
+ return baseValue + difference;
|
15
|
15
|
}
|
16
|
16
|
|
17
|
17
|
/**
|
|
@@ -20,7 +20,7 @@ public class MathUtilities {
|
20
|
20
|
* @return sum of `baseValue` and `difference`
|
21
|
21
|
*/
|
22
|
22
|
public Long add(long baseValue, long difference) {
|
23
|
|
- return null;
|
|
23
|
+ return baseValue + difference;
|
24
|
24
|
}
|
25
|
25
|
|
26
|
26
|
/**
|
|
@@ -29,7 +29,9 @@ public class MathUtilities {
|
29
|
29
|
* @return sum of `baseValue` and `difference`
|
30
|
30
|
*/
|
31
|
31
|
public Short add(short baseValue, short difference) {
|
32
|
|
- return null;
|
|
32
|
+ short sum = (short)(baseValue + difference);
|
|
33
|
+
|
|
34
|
+ return sum;
|
33
|
35
|
}
|
34
|
36
|
|
35
|
37
|
/**
|
|
@@ -38,7 +40,8 @@ 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
|
+ byte sum = (byte)(baseValue + difference);
|
|
44
|
+ return sum;
|
42
|
45
|
}
|
43
|
46
|
|
44
|
47
|
/**
|
|
@@ -47,7 +50,7 @@ public class MathUtilities {
|
47
|
50
|
* @return sum of `baseValue` and `difference`
|
48
|
51
|
*/
|
49
|
52
|
public Float add(float baseValue, float difference) {
|
50
|
|
- return null;
|
|
53
|
+ return baseValue + difference;
|
51
|
54
|
}
|
52
|
55
|
|
53
|
56
|
/**
|
|
@@ -56,7 +59,7 @@ 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
|
+ return baseValue + difference;
|
60
|
63
|
}
|
61
|
64
|
|
62
|
65
|
/**
|
|
@@ -65,7 +68,7 @@ public class MathUtilities {
|
65
|
68
|
* @return difference between `baseValue` and `difference`
|
66
|
69
|
*/
|
67
|
70
|
public Integer subtract(int baseValue, int difference) {
|
68
|
|
- return null;
|
|
71
|
+ return baseValue - difference;
|
69
|
72
|
}
|
70
|
73
|
|
71
|
74
|
/**
|
|
@@ -74,7 +77,7 @@ public class MathUtilities {
|
74
|
77
|
* @return difference between `baseValue` and `difference`
|
75
|
78
|
*/
|
76
|
79
|
public Long subtract(long baseValue, long difference) {
|
77
|
|
- return null;
|
|
80
|
+ return baseValue - difference;
|
78
|
81
|
}
|
79
|
82
|
|
80
|
83
|
/**
|
|
@@ -83,7 +86,8 @@ public class MathUtilities {
|
83
|
86
|
* @return difference between `baseValue` and `difference`
|
84
|
87
|
*/
|
85
|
88
|
public Short subtract(short baseValue, short difference) {
|
86
|
|
- return null;
|
|
89
|
+ short dif = (short)(baseValue - difference);
|
|
90
|
+ return dif;
|
87
|
91
|
}
|
88
|
92
|
|
89
|
93
|
/**
|
|
@@ -92,7 +96,8 @@ public class MathUtilities {
|
92
|
96
|
* @return difference between `baseValue` and `difference`
|
93
|
97
|
*/
|
94
|
98
|
public Byte subtract(byte baseValue, byte difference) {
|
95
|
|
- return null;
|
|
99
|
+ byte dif = (byte)(baseValue - difference);
|
|
100
|
+ return dif;
|
96
|
101
|
}
|
97
|
102
|
|
98
|
103
|
/**
|
|
@@ -101,7 +106,7 @@ public class MathUtilities {
|
101
|
106
|
* @return difference between `baseValue` and `difference`
|
102
|
107
|
*/
|
103
|
108
|
public Float subtract(float baseValue, float difference) {
|
104
|
|
- return null;
|
|
109
|
+ return baseValue - difference;
|
105
|
110
|
}
|
106
|
111
|
|
107
|
112
|
/**
|
|
@@ -110,7 +115,7 @@ public class MathUtilities {
|
110
|
115
|
* @return difference between `baseValue` and `difference`
|
111
|
116
|
*/
|
112
|
117
|
public Double subtract(double baseValue, double difference) {
|
113
|
|
- return null;
|
|
118
|
+ return baseValue - difference;
|
114
|
119
|
}
|
115
|
120
|
|
116
|
121
|
|
|
@@ -120,7 +125,7 @@ public class MathUtilities {
|
120
|
125
|
* @return division of `dividend` by `divisor
|
121
|
126
|
*/
|
122
|
127
|
public Integer divide(int dividend, int divisor) {
|
123
|
|
- return null;
|
|
128
|
+ return dividend / divisor;
|
124
|
129
|
}
|
125
|
130
|
|
126
|
131
|
/**
|
|
@@ -129,7 +134,7 @@ public class MathUtilities {
|
129
|
134
|
* @return division of `dividend` by `divisor
|
130
|
135
|
*/
|
131
|
136
|
public Long divide(long dividend, long divisor) {
|
132
|
|
- return null;
|
|
137
|
+ return dividend / divisor;
|
133
|
138
|
}
|
134
|
139
|
|
135
|
140
|
/**
|
|
@@ -138,7 +143,8 @@ public class MathUtilities {
|
138
|
143
|
* @return division of `dividend` by `divisor
|
139
|
144
|
*/
|
140
|
145
|
public Short divide(short dividend, short divisor) {
|
141
|
|
- return null;
|
|
146
|
+ short div = (short)(dividend / divisor);
|
|
147
|
+ return div;
|
142
|
148
|
}
|
143
|
149
|
|
144
|
150
|
/**
|
|
@@ -147,7 +153,8 @@ public class MathUtilities {
|
147
|
153
|
* @return division of `dividend` by `divisor
|
148
|
154
|
*/
|
149
|
155
|
public Byte divide(byte dividend, byte divisor) {
|
150
|
|
- return null;
|
|
156
|
+ byte div = (byte)(dividend / divisor);
|
|
157
|
+ return div;
|
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 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,8 @@ 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
|
+ short multi = (short)(multiplicand * multiplier);
|
|
204
|
+ return multi;
|
197
|
205
|
}
|
198
|
206
|
/**
|
199
|
207
|
* @param multiplicand value to be multiplied
|
|
@@ -201,7 +209,8 @@ public class MathUtilities {
|
201
|
209
|
* @return product of `multiplicand` by `multiplier`
|
202
|
210
|
*/
|
203
|
211
|
public Byte multiply(byte multiplicand, byte multiplier) {
|
204
|
|
- return null;
|
|
212
|
+ byte multi = (byte)(multiplicand * multiplier);
|
|
213
|
+ return multi;
|
205
|
214
|
}
|
206
|
215
|
|
207
|
216
|
/**
|
|
@@ -210,7 +219,7 @@ public class MathUtilities {
|
210
|
219
|
* @return product of `multiplicand` by `multiplier`
|
211
|
220
|
*/
|
212
|
221
|
public Float multiply(float multiplicand, float multiplier) {
|
213
|
|
- return null;
|
|
222
|
+ return multiplicand * multiplier;
|
214
|
223
|
}
|
215
|
224
|
|
216
|
225
|
/**
|
|
@@ -219,7 +228,7 @@ public class MathUtilities {
|
219
|
228
|
* @return product of `multiplicand` by `multiplier`
|
220
|
229
|
*/
|
221
|
230
|
public Double multiply(double multiplicand, double multiplier) {
|
222
|
|
- return null;
|
|
231
|
+ return multiplicand * multiplier;
|
223
|
232
|
}
|
224
|
233
|
|
225
|
234
|
|
|
@@ -227,14 +236,14 @@ public class MathUtilities {
|
227
|
236
|
* @return true
|
228
|
237
|
*/
|
229
|
238
|
public Boolean returnTrue() {
|
230
|
|
- return null;
|
|
239
|
+ return true;
|
231
|
240
|
}
|
232
|
241
|
|
233
|
242
|
/**
|
234
|
243
|
* @return false
|
235
|
244
|
*/
|
236
|
245
|
public Boolean returnFalse() {
|
237
|
|
- return null;
|
|
246
|
+ return false;
|
238
|
247
|
}
|
239
|
248
|
|
240
|
249
|
}
|