Browse Source

update correct version

Sean Mis 6 years ago
parent
commit
94bef8e321

+ 20
- 4
src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java View File

12
 
12
 
13
 
13
 
14
     public Boolean isGreaterThan(int x, int y) {
14
     public Boolean isGreaterThan(int x, int y) {
15
-        return x>y;
15
+        if ( x > y ) {
16
+            return true;
17
+        } else {
18
+            return false;
19
+        }
16
     }
20
     }
17
 
21
 
18
     /**
22
     /**
21
      * @return true if `x` is less than `y`
25
      * @return true if `x` is less than `y`
22
      */
26
      */
23
     public Boolean isLessThan(int x, int y) {
27
     public Boolean isLessThan(int x, int y) {
24
-        return x<y;
28
+        if ( x < y ) {
29
+            return true;
30
+        } else {
31
+            return false;
32
+        }
25
     }
33
     }
26
 
34
 
27
     /**
35
     /**
30
      * @return true if `x` is greater than or equal to `y`
38
      * @return true if `x` is greater than or equal to `y`
31
      */
39
      */
32
     public Boolean isGreaterThanOrEqualTo(int x, int y) {
40
     public Boolean isGreaterThanOrEqualTo(int x, int y) {
33
-        return x>=y;
41
+        if ( x >= y ) {
42
+            return true;
43
+        } else {
44
+            return false;
45
+        }
34
     }
46
     }
35
 
47
 
36
     /**
48
     /**
39
      * @return true if `x` is less than or equal to `y`
51
      * @return true if `x` is less than or equal to `y`
40
      */
52
      */
41
     public Boolean isLessThanOrEqualTo(int x, int y) {
53
     public Boolean isLessThanOrEqualTo(int x, int y) {
42
-        return x<=y;
54
+        if ( x <= y ) {
55
+            return true;
56
+        } else {
57
+            return false;
58
+        }
43
     }
59
     }
44
 }
60
 }