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