Nuridalia.Hernandez 6 lat temu
rodzic
commit
0cdddbdbc8

+ 4
- 0
src/main/java/rocks/zipcode/io/quiz4/collections/ComparableTreeSet.java Wyświetl plik

@@ -1,11 +1,14 @@
1 1
 package rocks.zipcode.io.quiz4.collections;
2 2
 
3
+import java.util.Set;
3 4
 import java.util.TreeSet;
4 5
 
5 6
 /**
6 7
  * @author leon on 11/12/2018.
7 8
  */
8 9
 public class ComparableTreeSet<_ > extends TreeSet implements Comparable  {
10
+    Set <_> myset = new TreeSet<>();
11
+
9 12
     public ComparableTreeSet(_... arr) {
10 13
     }
11 14
 
@@ -16,6 +19,7 @@ public class ComparableTreeSet<_ > extends TreeSet implements Comparable  {
16 19
     public Integer compareTo(ComparableTreeSet<_> o) {
17 20
 
18 21
 
22
+
19 23
         return null;
20 24
     }
21 25
 

+ 5
- 4
src/main/java/rocks/zipcode/io/quiz4/collections/ZipCodeWilmington.java Wyświetl plik

@@ -2,10 +2,7 @@ package rocks.zipcode.io.quiz4.collections;
2 2
 
3 3
 import rocks.zipcode.io.quiz4.objectorientation.Student;
4 4
 
5
-import java.util.ArrayList;
6
-import java.util.HashMap;
7
-import java.util.List;
8
-import java.util.Map;
5
+import java.util.*;
9 6
 
10 7
 /**
11 8
  * @author leon on 11/12/2018.
@@ -40,6 +37,10 @@ List<Student> studentList = new ArrayList<>();
40 37
     public Map<Student, Double> getStudyMap() {
41 38
 
42 39
         Map <Student, Double> myMap = new HashMap<>();
40
+        for (Student s :studentList) {
41
+            myMap.put(s, s.getTotalStudyTime());
42
+            
43
+        }
43 44
 
44 45
 
45 46
         return myMap;

+ 1
- 0
src/main/java/rocks/zipcode/io/quiz4/objectorientation/Student.java Wyświetl plik

@@ -15,6 +15,7 @@ public class Student {
15 15
     }
16 16
 
17 17
     public void learn(Double amountOfHours) {
18
+
18 19
         this.totalStudytime+= amountOfHours;
19 20
     }
20 21