Bladeren bron

working on arrays

jacob andersen 6 jaren geleden
bovenliggende
commit
30bf6647f4

+ 17
- 2
src/main/java/rocks/zipcode/io/quiz3/arrays/SquareArrayAnalyzer.java Bestand weergeven

@@ -4,7 +4,22 @@ package rocks.zipcode.io.quiz3.arrays;
4 4
  * @author leon on 09/12/2018.
5 5
  */
6 6
 public class SquareArrayAnalyzer {
7
-    public static Boolean compare(Integer[] input, Integer[] squaredValues) {
8
-        return null;
7
+    public static Boolean compare(Integer[] input, Integer[] squaredValues)
8
+    {
9
+        int count=0;
10
+
11
+        for (int i=0; i<input.length;i++){
12
+            for (int j=0;j<squaredValues.length;j++) {
13
+                if ((input[i] * input[i]) == squaredValues[j]) {
14
+                    count++;
15
+                }
16
+            }
17
+            }
18
+        if(count==input.length)
19
+        {
20
+            return true;
21
+        }
22
+
23
+        return false;
9 24
     }
10 25
 }

+ 1
- 0
src/main/java/rocks/zipcode/io/quiz3/arrays/WaveGenerator.java Bestand weergeven

@@ -5,6 +5,7 @@ package rocks.zipcode.io.quiz3.arrays;
5 5
  */
6 6
 public class WaveGenerator {
7 7
     public static String[] wave(String str) {
8
+
8 9
         return null;
9 10
     }
10 11
 }

+ 3
- 1
src/main/java/rocks/zipcode/io/quiz3/collections/Student.java Bestand weergeven

@@ -12,7 +12,9 @@ public class Student {
12 12
         this(null);
13 13
     }
14 14
 
15
-    public Student(Map<Lab, LabStatus> map) {
15
+    public Student(Map<Lab, LabStatus> map)
16
+    {
17
+
16 18
     }
17 19
 
18 20
     public void setLabStatus(Lab lab, LabStatus labStatus) {