|
@@ -0,0 +1,146 @@
|
|
1
|
+# Part 1.0 - Create `Person` Class
|
|
2
|
+* Create a `Person` class.
|
|
3
|
+ * `Person` constructor should have a parameter of type `String` which sets the `name` instance-variable to the respective argument.
|
|
4
|
+ * `Person` should have a `getName()` method which returns the `Person` object's `name` variable.
|
|
5
|
+ * `Person` should have a `setName()` method which sets the `Person` object's `name` variable.
|
|
6
|
+
|
|
7
|
+-
|
|
8
|
+# Part 1.1 - Test `Person`
|
|
9
|
+* Create a `TestPerson` class.
|
|
10
|
+ * Create a `testSetName` method which ensures that a `Person` object's `name` variable is being set by invoking the `.setName` method.
|
|
11
|
+ * Create a `testConstructor` method which ensures that a `Person` object's `name` variable is being set by invoking the `Person` constructor.
|
|
12
|
+
|
|
13
|
+-
|
|
14
|
+# Part 2.0 - Create `Learner` Interface
|
|
15
|
+* Create a `Learner` interface.
|
|
16
|
+ * `Learner` should declare one method signature:
|
|
17
|
+ * Method name: `learn`
|
|
18
|
+ * Method parameters: `double numberOfHours`
|
|
19
|
+ * Method return-type: `void`
|
|
20
|
+
|
|
21
|
+-
|
|
22
|
+# Part 3.0 - Create `Student` Class
|
|
23
|
+* Create a `Student` class such that:
|
|
24
|
+ * `Student` is a subclass of `Person`
|
|
25
|
+ * `Student` implements the `Learner` interface
|
|
26
|
+ * `Student` should have an instance variable `totalStudyTime` of type `double`
|
|
27
|
+ * `Student` should have a concrete implementation of the `learn` method which increments the `totalStudyTime` variable by the specified `numberOfHours` argument.
|
|
28
|
+ * `Student` should have a `getTotalStudyTime()` method which returns the `totalStudyTime` instance variable.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+-
|
|
32
|
+# Part 3.1 - Test `Student`
|
|
33
|
+* Create a `TestStudent` class.
|
|
34
|
+ * Create a `testImplementation` method that asserts that a `Student` is an `instanceof` a `Learner`.
|
|
35
|
+ * Create a `testInheritance` method that asserts that a `Student` is an `instanceof` a `Person`.
|
|
36
|
+ * Create a `testLearn` method that ensures a `Student`'s `totalStudyTime` instance variable is incremented by the specified `numberOfHours` by invoking the `.learn` method.
|
|
37
|
+
|
|
38
|
+-
|
|
39
|
+# Part 4.0 - Create `Teacher` Interface
|
|
40
|
+* Create a `Teacher` interface.
|
|
41
|
+ * `Teacher` should declare a `teach` method signature:
|
|
42
|
+ * Method name: `teach`
|
|
43
|
+ * Method parameters:
|
|
44
|
+ * `Student student`
|
|
45
|
+ * `double numberOfHours`
|
|
46
|
+ * Method return-type: `void`
|
|
47
|
+
|
|
48
|
+ * `Teacher` should declare a `lecture` method signature:
|
|
49
|
+ * Method name: `lecture`
|
|
50
|
+ * Method parameters:
|
|
51
|
+ * `Student[] student, double numberOfHours`
|
|
52
|
+ * Method return-type: `void`
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+-
|
|
56
|
+# Part 5.0 - Create `Instructor` Class
|
|
57
|
+* Create an `Instructor` class such that:
|
|
58
|
+ * `Instructor` is a subclass of `Person`
|
|
59
|
+ * `Instructor` implements the `Teacher` interface
|
|
60
|
+ * `Instructor` should have a concrete implementation of the `teach` method which invokes the `learn` method on the specified `Student` object.
|
|
61
|
+ * `Instructor` should have a concrete implementation of the `lecture` method which invokes the `learn` method on the specified array of `Student` objects.
|
|
62
|
+ * `numberOfHours` should be evenly split amongst the students.
|
|
63
|
+ * `double numberOfHoursPerStudent = numberOfHours / students.length;`
|
|
64
|
+
|
|
65
|
+-
|
|
66
|
+# Part 5.1 - Test `Instructor`
|
|
67
|
+* Create an `TestInstructor` class.
|
|
68
|
+ * Create a `testImplementation` method that asserts that an `Instructor` is an `instanceof` a `Teacher`.
|
|
69
|
+ * Create a `testInheritance` method that asserts that a `Instructor` is an `instanceof` a `Person`.
|
|
70
|
+ * Create a `testTeach` method that ensures when an `Instructor` invokes the `.teach` method, a respective student's `totalStudyTime` instance variable is incremented.
|
|
71
|
+ * Create a `testLecture` method that ensures when an `Instructor` invokes the `.teach` method, a respective student's `totalStudyTime` instance variable is incremented.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+-
|
|
75
|
+# Part 6 - Create `ZipCodeWilmington` Class
|
|
76
|
+* Create a `ZipCodeWilmington` class.
|
|
77
|
+ * _Statically_ instantiate a `private` `ArrayList` of `Instructor` objects called `instructorList`.
|
|
78
|
+ * Create a `public static` method called `hire` which adds an `Instructor` to the `instructorList` and returns `void`.
|
|
79
|
+ * Create a `public static` method called `getInstructors` which returns the `instructorList`.
|
|
80
|
+ * Create a `public static` method called `fireStaff` which clears our `instructorList`.
|
|
81
|
+ * Copy and paste this `static initialization block` immediately below your `instructorList` declaration.
|
|
82
|
+
|
|
83
|
+```java
|
|
84
|
+static { // static initializer
|
|
85
|
+ String[] instructorNames = { "Leon", "Tariq", "Froilan", "David", "Zach", "Iyasu" };
|
|
86
|
+ for (String instructorName : instructorNames) {
|
|
87
|
+ Instructor instructor = new Instructor(instructorName);
|
|
88
|
+ hire(instructor);
|
|
89
|
+ }
|
|
90
|
+}
|
|
91
|
+```
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+-
|
|
95
|
+# Part 6.1 - Test `ZipCodeWilmington`
|
|
96
|
+* Create a `TestZipCodeWilmington` class.
|
|
97
|
+ * Create a method named `setup` which is annotated with `@Before`, takes has no parameters, and returns `void`.
|
|
98
|
+ * Ensure this method invokes the `.fireStaff` method on `ZipCodeWilmington`
|
|
99
|
+
|
|
100
|
+ * Create a `testFireStaff` method which ensures that our `instructorList` in our `ZipCodeWilmington` class `isEmpty` upon invokation.
|
|
101
|
+ * Create a `testHireStaff` method which ensures that our `instructorList` is populated with respective `Instructor` objects.
|
|
102
|
+
|
|
103
|
+-
|
|
104
|
+# Part 7 - Create `TechConnect` Class
|
|
105
|
+* Create a `TechConnect` class.
|
|
106
|
+ * _Statically_ instantiate a `private` `ArrayList` of `Student` objects called `studentList`.
|
|
107
|
+ * Create a `public static` method called `recruitStudent` which adds a `Student` to the `studentList` and returns `void`.
|
|
108
|
+ * Create a `public static` method called `getStudents` which returns the `studentList`.
|
|
109
|
+ * Create a `public static` method called `removeStudents` which clears our `studentList`.
|
|
110
|
+ * Copy and paste this `static initialization block` immediately below your `studentList` declaration.
|
|
111
|
+
|
|
112
|
+```java
|
|
113
|
+static { // static initializer
|
|
114
|
+ String[] studentNames = { "Karen", "Liel", "Quinn", "Destiny", "Blesson", "Danielle B.", "Andre", "Jeff",
|
|
115
|
+ "Carlo", "Julia D.", "Natalie", "Julia E.", "Shylee", "Genevieve", "Margo", "Whitney", "Rachel",
|
|
116
|
+ "Bridget", "Seung", "Jessica", "Harry", "Kesler", "Darin", "Jade", "Dominika", "Nashae", "Brianna",
|
|
117
|
+ "Laurent", "Rina", "Emily", "Elisha", "Caitlin", "Kierra", "Dana", "Alyssa", "Humaira", "Prajwal",
|
|
118
|
+ "Cristine", "Blesson", "Brendan" };
|
|
119
|
+ for (String studentName : studentNames) {
|
|
120
|
+ Student student = new Student(studentName);
|
|
121
|
+ studentList.add(student);
|
|
122
|
+ }
|
|
123
|
+}
|
|
124
|
+```
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+-
|
|
128
|
+# Part 7.1 - Test `TechConnect`
|
|
129
|
+* Create a `TestTechConnect` class.
|
|
130
|
+ * Create a method named `setup` which is annotated with `@Before`, takes has no parameters, and returns `void`.
|
|
131
|
+ * Ensure this method invokes the `.removeStudents` method on `TechConnect`
|
|
132
|
+
|
|
133
|
+ * Create a `testRemoveStudents` method which ensures that our `studentList` in our `TechConnect` class `isEmpty` upon invokation.
|
|
134
|
+ * Create a `testRecruitStudent` method which ensures that our `studentList` is populated with respective `Student` objects.
|
|
135
|
+
|
|
136
|
+-
|
|
137
|
+# Part 8 - Create `ClassRoom` Class
|
|
138
|
+* Create a `ClassRoom` class.
|
|
139
|
+ * _Statically_ instantiate a `private` `ArrayList` of `Student` objects called `students` by invoking the `getStudents` method on the `TechConnect` class.
|
|
140
|
+ * _Statically_ instantiate a `private` `ArrayList` of `Instructor` objects called `instructors` by invoking the `getInstructor` method on the `ZipCodeWilmington` class.
|
|
141
|
+ * Create a method named `getRoster` which returns a `HashMapping` of `String` to `Person` objects such that our `ZipCodeWilmington` instructors and `TechConnect` students' names map to their respective `Person` object.
|
|
142
|
+
|
|
143
|
+-
|
|
144
|
+# Part 8.1 - Test `ClassRoom`
|
|
145
|
+* Create a `TestClassRoom` class.
|
|
146
|
+ * Assert that the `HashMapping` returned by `getRoster`, returns a `valueSet` containing each of the `Person` objects in `ZipCodeWilmington`'s `instructorList` and `TechConnect`'s `studentList`.
|