nafis nibir 6 years ago
parent
commit
a4709c1242
3 changed files with 15 additions and 2 deletions
  1. BIN
      LargestInteger.class
  2. 15
    2
      LargestInteger.java
  3. BIN
      NormalizeAngle.class

BIN
LargestInteger.class View File


+ 15
- 2
LargestInteger.java View File

5
 
5
 
6
     public Integer findLargestNumberUsingConditional(Integer[] integers){
6
     public Integer findLargestNumberUsingConditional(Integer[] integers){
7
         
7
         
8
-        return null;
8
+        int big = 0;
9
+        int x = integers[0];
10
+        int y = integers[1];
11
+        int z = integers[2];
12
+        
13
+        if ( x>y && x>z ){
14
+            big = x;
15
+        } else if (y>x && y>z){
16
+            big = y;
17
+        } else if (z>x && z>y) {
18
+            big = z;
19
+        }
20
+        
21
+        return big;
9
        
22
        
10
     }
23
     }
11
     
24
     
12
     public Integer findLargestNumberUsingMathMax(Integer[] integers){
25
     public Integer findLargestNumberUsingMathMax(Integer[] integers){
13
-        return null;
26
+        return Math.max(integers[0],Math.max(integers[1],integers[2]));
14
     }
27
     }
15
     
28
     
16
 }
29
 }

BIN
NormalizeAngle.class View File