|
@@ -2,23 +2,31 @@ 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;
|
5
|
8
|
import java.util.Map;
|
6
|
9
|
|
7
|
10
|
/**
|
8
|
11
|
* @author leon on 11/12/2018.
|
9
|
12
|
*/
|
10
|
13
|
public class ZipCodeWilmington {
|
|
14
|
+ HashMap<Student, Double> students = new HashMap<>();
|
|
15
|
+
|
11
|
16
|
public void enroll(Student student) {
|
|
17
|
+ students.put(student, 0.0);
|
12
|
18
|
}
|
13
|
19
|
|
14
|
20
|
public Boolean isEnrolled(Student student) {
|
15
|
|
- return null;
|
|
21
|
+ return students.containsKey(student);
|
16
|
22
|
}
|
17
|
23
|
|
18
|
24
|
public void lecture(double numberOfHours) {
|
|
25
|
+ //students.forEach((student, aDouble) -> student.learn(numberOfHours));
|
|
26
|
+ students.keySet().forEach(student -> student.learn(numberOfHours));
|
19
|
27
|
}
|
20
|
28
|
|
21
|
29
|
public Map<Student, Double> getStudyMap() {
|
22
|
|
- return null;
|
|
30
|
+ return students;
|
23
|
31
|
}
|
24
|
32
|
}
|