|
|
|
|
6
|
### Part 1.1 - Create `Person` Class
|
6
|
### Part 1.1 - Create `Person` Class
|
7
|
* Create a `Person` class.
|
7
|
* Create a `Person` class.
|
8
|
* The class should declare a `final` field named `id` of type `long`.
|
8
|
* The class should declare a `final` field named `id` of type `long`.
|
|
|
9
|
+ * The class should declare a field named `name` of type `String`.
|
9
|
* `Person` constructor should have a parameter of type `long` which sets the `id` field to the respective value.
|
10
|
* `Person` constructor should have a parameter of type `long` which sets the `id` field to the respective value.
|
10
|
* The class should define a `getId()` method which returns the `Person` object's `id` field.
|
11
|
* The class should define a `getId()` method which returns the `Person` object's `id` field.
|
11
|
* The class should define a `getName()` method which returns the `Person` object's `name` field.
|
12
|
* The class should define a `getName()` method which returns the `Person` object's `name` field.
|
|
|
|
|
75
|
* Create a `TestInstructor` class.
|
76
|
* Create a `TestInstructor` class.
|
76
|
* Create a `testImplementation` method that asserts that an `Instructor` is an `instanceof` a `Teacher`.
|
77
|
* Create a `testImplementation` method that asserts that an `Instructor` is an `instanceof` a `Teacher`.
|
77
|
* Create a `testInheritance` method that asserts that a `Instructor` is an `instanceof` a `Person`.
|
78
|
* Create a `testInheritance` method that asserts that a `Instructor` is an `instanceof` a `Person`.
|
78
|
- * Create a `testTeach` method that ensures when an `Instructor` invokes the `.teach` method, a respective student's `totalStudyTime` instance variable is incremented.
|
|
|
79
|
- * Create a `testLecture` method that ensures when an `Instructor` invokes the `.teach` method, a respective student's `totalStudyTime` instance variable is incremented by the specified `numberOfHours`.
|
|
|
|
|
79
|
+ * Create a `testTeach` method that ensures when an `Instructor` invokes the `teach` method, a respective student's `totalStudyTime` instance variable is incremented by the specified `numberOfHours`.
|
|
|
80
|
+ * Create a `testLecture` method that ensures when an `Instructor` invokes the `lecture` method, a respective array of students' `totalStudyTime` instance variables is incremented by `numberOfHours/students.length`.
|
80
|
|
81
|
|
81
|
|
82
|
|
82
|
-
|
83
|
-
|