|
@@ -1,17 +1,17 @@
|
1
|
|
-package com.zipcodewilmington.danny_do_better;
|
|
1
|
+package com.zipcodewilmington.danny_do_better_exercises;
|
2
|
2
|
|
3
|
3
|
/**
|
4
|
4
|
* Created by dan on 6/14/17.
|
5
|
5
|
*/
|
6
|
|
-public class PrimativeTypes {
|
|
6
|
+public class PrimitiveTypes {
|
7
|
7
|
|
8
|
8
|
/**
|
9
|
9
|
* @param baseValue starting value
|
10
|
10
|
* @param difference value to add to starting value
|
11
|
11
|
* @return sum of `baseValue` and `difference`
|
12
|
12
|
*/
|
13
|
|
- public int add(int baseValue, int difference) {
|
14
|
|
- return 0;
|
|
13
|
+ public Integer add(int baseValue, int difference) {
|
|
14
|
+ return null;
|
15
|
15
|
}
|
16
|
16
|
|
17
|
17
|
/**
|
|
@@ -19,8 +19,8 @@ public class PrimativeTypes {
|
19
|
19
|
* @param difference value to add to starting value
|
20
|
20
|
* @return sum of `baseValue` and `difference`
|
21
|
21
|
*/
|
22
|
|
- public long add(long baseValue, long difference) {
|
23
|
|
- return 0;
|
|
22
|
+ public Long add(long baseValue, long difference) {
|
|
23
|
+ return null;
|
24
|
24
|
}
|
25
|
25
|
|
26
|
26
|
/**
|
|
@@ -28,8 +28,8 @@ public class PrimativeTypes {
|
28
|
28
|
* @param difference value to add to starting value
|
29
|
29
|
* @return sum of `baseValue` and `difference`
|
30
|
30
|
*/
|
31
|
|
- public short add(short baseValue, short difference) {
|
32
|
|
- return 0;
|
|
31
|
+ public Short add(short baseValue, short difference) {
|
|
32
|
+ return null;
|
33
|
33
|
}
|
34
|
34
|
|
35
|
35
|
/**
|
|
@@ -37,8 +37,8 @@ public class PrimativeTypes {
|
37
|
37
|
* @param difference value to add to starting value
|
38
|
38
|
* @return sum of `baseValue` and `difference`
|
39
|
39
|
*/
|
40
|
|
- public byte add(byte baseValue, byte difference) {
|
41
|
|
- return 0;
|
|
40
|
+ public Byte add(byte baseValue, byte difference) {
|
|
41
|
+ return null;
|
42
|
42
|
}
|
43
|
43
|
|
44
|
44
|
/**
|
|
@@ -46,8 +46,8 @@ public class PrimativeTypes {
|
46
|
46
|
* @param difference value to add to starting value
|
47
|
47
|
* @return sum of `baseValue` and `difference`
|
48
|
48
|
*/
|
49
|
|
- public float add(float baseValue, float difference) {
|
50
|
|
- return 0;
|
|
49
|
+ public Float add(float baseValue, float difference) {
|
|
50
|
+ return null;
|
51
|
51
|
}
|
52
|
52
|
|
53
|
53
|
/**
|
|
@@ -55,8 +55,8 @@ public class PrimativeTypes {
|
55
|
55
|
* @param difference value to add to starting value
|
56
|
56
|
* @return sum of `baseValue` and `difference`
|
57
|
57
|
*/
|
58
|
|
- public double add(double baseValue, double difference) {
|
59
|
|
- return 0;
|
|
58
|
+ public Double add(double baseValue, double difference) {
|
|
59
|
+ return null;
|
60
|
60
|
}
|
61
|
61
|
|
62
|
62
|
/**
|
|
@@ -64,8 +64,8 @@ public class PrimativeTypes {
|
64
|
64
|
* @param difference value to subtract from starting value
|
65
|
65
|
* @return difference between `baseValue` and `difference`
|
66
|
66
|
*/
|
67
|
|
- public int subtract(int baseValue, int difference) {
|
68
|
|
- return 0;
|
|
67
|
+ public Integer subtract(int baseValue, int difference) {
|
|
68
|
+ return null;
|
69
|
69
|
}
|
70
|
70
|
|
71
|
71
|
/**
|
|
@@ -73,8 +73,8 @@ public class PrimativeTypes {
|
73
|
73
|
* @param difference value to subtract from starting value
|
74
|
74
|
* @return difference between `baseValue` and `difference`
|
75
|
75
|
*/
|
76
|
|
- public long subtract(long baseValue, long difference) {
|
77
|
|
- return 0;
|
|
76
|
+ public Long subtract(long baseValue, long difference) {
|
|
77
|
+ return null;
|
78
|
78
|
}
|
79
|
79
|
|
80
|
80
|
/**
|
|
@@ -82,8 +82,8 @@ public class PrimativeTypes {
|
82
|
82
|
* @param difference value to subtract from starting value
|
83
|
83
|
* @return difference between `baseValue` and `difference`
|
84
|
84
|
*/
|
85
|
|
- public short subtract(short baseValue, short difference) {
|
86
|
|
- return 0;
|
|
85
|
+ public Short subtract(short baseValue, short difference) {
|
|
86
|
+ return null;
|
87
|
87
|
}
|
88
|
88
|
|
89
|
89
|
/**
|
|
@@ -91,8 +91,8 @@ public class PrimativeTypes {
|
91
|
91
|
* @param difference value to subtract from starting value
|
92
|
92
|
* @return difference between `baseValue` and `difference`
|
93
|
93
|
*/
|
94
|
|
- public byte subtract(byte baseValue, byte difference) {
|
95
|
|
- return 0;
|
|
94
|
+ public Byte subtract(byte baseValue, byte difference) {
|
|
95
|
+ return null;
|
96
|
96
|
}
|
97
|
97
|
|
98
|
98
|
/**
|
|
@@ -100,8 +100,8 @@ public class PrimativeTypes {
|
100
|
100
|
* @param difference value to subtract from starting value
|
101
|
101
|
* @return difference between `baseValue` and `difference`
|
102
|
102
|
*/
|
103
|
|
- public float subtract(float baseValue, float difference) {
|
104
|
|
- return 0;
|
|
103
|
+ public Float subtract(float baseValue, float difference) {
|
|
104
|
+ return null;
|
105
|
105
|
}
|
106
|
106
|
|
107
|
107
|
/**
|
|
@@ -109,8 +109,8 @@ public class PrimativeTypes {
|
109
|
109
|
* @param difference value to subtract from starting value
|
110
|
110
|
* @return difference between `baseValue` and `difference`
|
111
|
111
|
*/
|
112
|
|
- public double subtract(double baseValue, double difference) {
|
113
|
|
- return 0;
|
|
112
|
+ public Double subtract(double baseValue, double difference) {
|
|
113
|
+ return null;
|
114
|
114
|
}
|
115
|
115
|
|
116
|
116
|
|
|
@@ -119,8 +119,8 @@ public class PrimativeTypes {
|
119
|
119
|
* @param divisor value to divide by
|
120
|
120
|
* @return division of `dividend` by `divisor
|
121
|
121
|
*/
|
122
|
|
- public int divide(int dividend, int divisor) {
|
123
|
|
- return 0;
|
|
122
|
+ public Integer divide(int dividend, int divisor) {
|
|
123
|
+ return null;
|
124
|
124
|
}
|
125
|
125
|
|
126
|
126
|
/**
|
|
@@ -128,8 +128,8 @@ public class PrimativeTypes {
|
128
|
128
|
* @param divisor value to divide by
|
129
|
129
|
* @return division of `dividend` by `divisor
|
130
|
130
|
*/
|
131
|
|
- public long divide(long dividend, long divisor) {
|
132
|
|
- return 0;
|
|
131
|
+ public Long divide(long dividend, long divisor) {
|
|
132
|
+ return null;
|
133
|
133
|
}
|
134
|
134
|
|
135
|
135
|
/**
|
|
@@ -137,8 +137,8 @@ public class PrimativeTypes {
|
137
|
137
|
* @param divisor value to divide by
|
138
|
138
|
* @return division of `dividend` by `divisor
|
139
|
139
|
*/
|
140
|
|
- public short divide(short dividend, short divisor) {
|
141
|
|
- return 0;
|
|
140
|
+ public Short divide(short dividend, short divisor) {
|
|
141
|
+ return null;
|
142
|
142
|
}
|
143
|
143
|
|
144
|
144
|
/**
|
|
@@ -146,8 +146,8 @@ public class PrimativeTypes {
|
146
|
146
|
* @param divisor value to divide by
|
147
|
147
|
* @return division of `dividend` by `divisor
|
148
|
148
|
*/
|
149
|
|
- public byte divide(byte dividend, byte divisor) {
|
150
|
|
- return 0;
|
|
149
|
+ public Byte divide(byte dividend, byte divisor) {
|
|
150
|
+ return null;
|
151
|
151
|
}
|
152
|
152
|
|
153
|
153
|
/**
|
|
@@ -155,8 +155,8 @@ public class PrimativeTypes {
|
155
|
155
|
* @param divisor value to divide by
|
156
|
156
|
* @return division of `dividend` by `divisor
|
157
|
157
|
*/
|
158
|
|
- public float divide(float dividend, float divisor) {
|
159
|
|
- return 0;
|
|
158
|
+ public Float divide(float dividend, float divisor) {
|
|
159
|
+ return null;
|
160
|
160
|
}
|
161
|
161
|
|
162
|
162
|
/**
|
|
@@ -164,8 +164,8 @@ public class PrimativeTypes {
|
164
|
164
|
* @param divisor value to divide by
|
165
|
165
|
* @return division of `dividend` by `divisor
|
166
|
166
|
*/
|
167
|
|
- public double divide(double dividend, double divisor) {
|
168
|
|
- return 0;
|
|
167
|
+ public Double divide(double dividend, double divisor) {
|
|
168
|
+ return null;
|
169
|
169
|
}
|
170
|
170
|
|
171
|
171
|
|
|
@@ -174,8 +174,8 @@ public class PrimativeTypes {
|
174
|
174
|
* @param multiplier value to multiply by
|
175
|
175
|
* @return product of `multiplicand` by `multiplier`
|
176
|
176
|
*/
|
177
|
|
- public int multiply(int multiplicand, int multiplier) {
|
178
|
|
- return 0;
|
|
177
|
+ public Integer multiply(int multiplicand, int multiplier) {
|
|
178
|
+ return null;
|
179
|
179
|
}
|
180
|
180
|
|
181
|
181
|
/**
|
|
@@ -183,8 +183,8 @@ public class PrimativeTypes {
|
183
|
183
|
* @param multiplier value to multiply by
|
184
|
184
|
* @return product of `multiplicand` by `multiplier`
|
185
|
185
|
*/
|
186
|
|
- public long multiply(long multiplicand, long multiplier) {
|
187
|
|
- return 0;
|
|
186
|
+ public Long multiply(long multiplicand, long multiplier) {
|
|
187
|
+ return null;
|
188
|
188
|
}
|
189
|
189
|
|
190
|
190
|
/**
|
|
@@ -192,16 +192,16 @@ public class PrimativeTypes {
|
192
|
192
|
* @param multiplier value to multiply by
|
193
|
193
|
* @return product of `multiplicand` by `multiplier`
|
194
|
194
|
*/
|
195
|
|
- public short multiply(short multiplicand, short multiplier) {
|
196
|
|
- return 0;
|
|
195
|
+ public Short multiply(short multiplicand, short multiplier) {
|
|
196
|
+ return null;
|
197
|
197
|
}
|
198
|
198
|
/**
|
199
|
199
|
* @param multiplicand value to be multiplied
|
200
|
200
|
* @param multiplier value to multiply by
|
201
|
201
|
* @return product of `multiplicand` by `multiplier`
|
202
|
202
|
*/
|
203
|
|
- public byte multiply(byte multiplicand, byte multiplier) {
|
204
|
|
- return 0;
|
|
203
|
+ public Byte multiply(byte multiplicand, byte multiplier) {
|
|
204
|
+ return null;
|
205
|
205
|
}
|
206
|
206
|
|
207
|
207
|
/**
|
|
@@ -209,8 +209,8 @@ public class PrimativeTypes {
|
209
|
209
|
* @param multiplier value to multiply by
|
210
|
210
|
* @return product of `multiplicand` by `multiplier`
|
211
|
211
|
*/
|
212
|
|
- public float multiply(float multiplicand, float multiplier) {
|
213
|
|
- return 0;
|
|
212
|
+ public Float multiply(float multiplicand, float multiplier) {
|
|
213
|
+ return null;
|
214
|
214
|
}
|
215
|
215
|
|
216
|
216
|
/**
|
|
@@ -218,23 +218,23 @@ public class PrimativeTypes {
|
218
|
218
|
* @param multiplier value to multiply by
|
219
|
219
|
* @return product of `multiplicand` by `multiplier`
|
220
|
220
|
*/
|
221
|
|
- public double multiply(double multiplicand, double multiplier) {
|
222
|
|
- return 0;
|
|
221
|
+ public Double multiply(double multiplicand, double multiplier) {
|
|
222
|
+ return null;
|
223
|
223
|
}
|
224
|
224
|
|
225
|
225
|
|
226
|
226
|
/**
|
227
|
227
|
* @return true
|
228
|
228
|
*/
|
229
|
|
- public boolean returnTrue() {
|
230
|
|
- return false;
|
|
229
|
+ public Boolean returnTrue() {
|
|
230
|
+ return null;
|
231
|
231
|
}
|
232
|
232
|
|
233
|
233
|
/**
|
234
|
234
|
* @return false
|
235
|
235
|
*/
|
236
|
|
- public boolean returnFalse() {
|
237
|
|
- return true;
|
|
236
|
+ public Boolean returnFalse() {
|
|
237
|
+ return null;
|
238
|
238
|
}
|
239
|
239
|
|
240
|
240
|
}
|