Ver código fonte

pre-merge commit

Nathan Hall 5 anos atrás
pai
commit
21948b0ef9

+ 1
- 0
src/main/java/rocks/zipcode/io/quiz4/collections/ComparableTreeSet.java Ver arquivo

@@ -5,6 +5,7 @@ package rocks.zipcode.io.quiz4.collections;
5 5
  */
6 6
 public class ComparableTreeSet<_> {
7 7
     public ComparableTreeSet(_... arr) {
8
+
8 9
     }
9 10
 
10 11
 

+ 1
- 0
src/main/java/rocks/zipcode/io/quiz4/collections/SimpleStringGroup.java Ver arquivo

@@ -9,6 +9,7 @@ public class SimpleStringGroup {
9 9
     }
10 10
 
11 11
     public Integer count() {
12
+
12 13
         return null;
13 14
     }
14 15
 

+ 7
- 0
src/main/java/rocks/zipcode/io/quiz4/collections/ZipCodeWilmington.java Ver arquivo

@@ -8,17 +8,24 @@ import java.util.Map;
8 8
  * @author leon on 11/12/2018.
9 9
  */
10 10
 public class ZipCodeWilmington {
11
+    private Student student;
12
+    private double numberOfHours;
13
+
11 14
     public void enroll(Student student) {
15
+        this.student = student;
12 16
     }
13 17
 
14 18
     public Boolean isEnrolled(Student student) {
19
+
15 20
         return null;
16 21
     }
17 22
 
18 23
     public void lecture(double numberOfHours) {
24
+        this.numberOfHours = numberOfHours;
19 25
     }
20 26
 
21 27
     public Map<Student, Double> getStudyMap() {
28
+
22 29
         return null;
23 30
     }
24 31
 }

+ 15
- 1
src/main/java/rocks/zipcode/io/quiz4/fundamentals/StringEvaluator.java Ver arquivo

@@ -1,12 +1,26 @@
1 1
 package rocks.zipcode.io.quiz4.fundamentals;
2 2
 
3
+import java.util.ArrayList;
4
+import java.util.List;
5
+
3 6
 /**
4 7
  * @author leon on 11/12/2018.
5 8
  */
6 9
 public class StringEvaluator {
7 10
     public static String[] getAllPrefixes(String string) {
8 11
 
9
-        return null;
12
+        StringBuilder builder = new StringBuilder();
13
+        int index = 0;
14
+//        for (int j = 0; j < string.length()-1; j++) {
15
+
16
+            for (int i = 0; i < string.length(); i++) {
17
+                builder.append(string.charAt(i) + ",");
18
+                for (int j = 1; j < string.length()-1; j++) {
19
+                    builder.append(string.substring(i) + ",");
20
+                }
21
+            }
22
+
23
+        return builder.toString().split(",");
10 24
     }
11 25
 
12 26
     public static String[] getCommonPrefixes(String string1, String string2) {