|
@@ -6,7 +6,7 @@ public class MathUtilities{
|
6
|
6
|
* @return the sum of the two numbers
|
7
|
7
|
*/
|
8
|
8
|
public int add(int num1, int num2){
|
9
|
|
- return -1;
|
|
9
|
+ return (num1 + num2);
|
10
|
10
|
}
|
11
|
11
|
|
12
|
12
|
/**
|
|
@@ -16,7 +16,7 @@ public class MathUtilities{
|
16
|
16
|
* @return the sum of the two numbers
|
17
|
17
|
*/
|
18
|
18
|
public double add(double num1, double num2){
|
19
|
|
- return -1;
|
|
19
|
+ return (num1 + num2);
|
20
|
20
|
}
|
21
|
21
|
|
22
|
22
|
/**
|
|
@@ -25,7 +25,7 @@ public class MathUtilities{
|
25
|
25
|
* @return the half of the number in double
|
26
|
26
|
*/
|
27
|
27
|
public double half(int number) {
|
28
|
|
- return -1;
|
|
28
|
+ return (number/2.0);
|
29
|
29
|
}
|
30
|
30
|
|
31
|
31
|
/**
|
|
@@ -34,7 +34,7 @@ public class MathUtilities{
|
34
|
34
|
* @return true if the number is odd, false if it is even
|
35
|
35
|
*/
|
36
|
36
|
public boolean isOdd(int number){
|
37
|
|
- return false;
|
|
37
|
+ return ((number%2) == 1);
|
38
|
38
|
}
|
39
|
39
|
|
40
|
40
|
|
|
@@ -44,7 +44,7 @@ public class MathUtilities{
|
44
|
44
|
* @return the result of the number multiply by itself
|
45
|
45
|
*/
|
46
|
46
|
public int square(int number) {
|
47
|
|
- return -1;
|
|
47
|
+ return (number * number);
|
48
|
48
|
}
|
49
|
49
|
|
50
|
50
|
}
|