Git-Leon f2bf29715f Update pom.xml | 7 年 前 | |
---|---|---|
src | 7 年 前 | |
.gitignore | 7 年 前 | |
.project | 7 年 前 | |
README.md | 7 年 前 | |
pom.xml | 7 年 前 |
Person
ClassPerson
class.
Person
constructor should have a parameter of type String
which sets the name
instance-variable to the respective value.Person
should have a getName()
method which returns the Person
object's name
variable.Person
should have a setName()
method which sets the Person
object's name
variable.-
Person
TestPerson
class.
testSetName
method which ensures that a Person
object's name
variable is being set by invoking the .setName
method.testConstructor
method which ensures that a Person
object's name
variable is being set by invoking the Person
constructor.-
Learner
InterfaceLearner
interface.
Learner
should declare one method signature:
learn
double numberOfHours
void
-
Student
ClassStudent
class such that:
Student
is a subclass of Person
Student
implements the Learner
interfaceStudent
should have an instance variable totalStudyTime
of type double
Student
should have a concrete implementation of the learn
method which increments the totalStudyTime
variable by the specified numberOfHours
argument.Student
should have a getTotalStudyTime()
method which returns the totalStudyTime
instance variable.-
Student
TestStudent
class.
testImplementation
method that asserts that a Student
is an instanceof
a Learner
.testInheritance
method that asserts that a Student
is an instanceof
a Person
.testLearn
method that ensures a Student
's totalStudyTime
instance variable is incremented by the specified numberOfHours
by invoking the .learn
method.-
Teacher
InterfaceCreate a Teacher
interface.
Teacher
should declare a teach
method signature:
teach
Student student
double numberOfHours
void
Teacher
should declare a lecture
method signature:
lecture
Student[] student
double numberOfHours
void
-
Instructor
ClassInstructor
class such that:
Instructor
is a subclass of Person
Instructor
implements the Teacher
interfaceInstructor
should have a concrete implementation of the teach
method which invokes the learn
method on the specified Student
object.Instructor
should have a concrete implementation of the lecture
method which invokes the learn
method on each of the elements in the specified array of Student
objects.
numberOfHours
should be evenly split amongst the students.
double numberOfHoursPerStudent = numberOfHours / students.length;
-
Instructor
TestInstructor
class.
testImplementation
method that asserts that an Instructor
is an instanceof
a Teacher
.testInheritance
method that asserts that a Instructor
is an instanceof
a Person
.testTeach
method that ensures when an Instructor
invokes the .teach
method, a respective student's totalStudyTime
instance variable is incremented.testLecture
method that ensures when an Instructor
invokes the .teach
method, a respective student's totalStudyTime
instance variable is incremented by the specified numberOfHours
.-
Cohort
classCohort
class.
ArrayList
field of Student
objects named studentList
.addStudent
which adds a Student
to the studentList
.getStudents
which returns an array representation of the studentList
.removeStudents
which clears our studentList
.
-
Cohort
TestCohort
class.
testAddStudent
method which ensures that our studentList
in our Cohort
class populated with respective Student
objects following invokation of the addStudent
method.testRemoveStudents
method which ensures that our studentList
in our Cohort
class is depopulated with respective Student
objects following invokation of the removeStudent
method.
-
MyCohort
singletonTestMyCohort
class.
test
method which ensures that each of the students in your current cohort are in your MyCohort
singleton.-
MyCohort
singletonMyCohort
class using the singleton design pattern.
private
Cohort
field with Student
object-representations of each of your classmates.Cohort
field should be exposed to the client via a getCohort
method.-
ZipCodeWilmington
ClassZipCodeWilmington
class.
private
ArrayList
of Instructor
objects named instructorList
.public static
method named hire
which adds an Instructor
to the instructorList
and returns void
.public static
method named getInstructors
which returns the instructorList
.public static
method named fireStaff
which clears our instructorList
.static initialization block
immediately below your instructorList
declaration.static { // static initializer
String[] instructorNames = { "Leon", "Tariq", "Froilan", "David", "Zach", "Iyasu" };
for (String instructorName : instructorNames) {
Instructor instructor = new Instructor(instructorName);
hire(instructor);
}
}
-
ZipCodeWilmington
Create a TestZipCodeWilmington
class.
Create a method named setup
which is annotated with @Before
, takes has no parameters, and returns void
.
.fireStaff
method on ZipCodeWilmington
Create a testFireStaff
method which ensures that our instructorList
in our ZipCodeWilmington
class isEmpty
upon invokation.
Create a testHireStaff
method which ensures that our instructorList
is populated with respective Instructor
objects.
-
Classroom
ClassTechConnect
class.
ArrayList
field of Student
objects named studentList
.public static
method named recruitStudent
which adds a Student
to the studentList
and returns void
.public static
method named getStudents
which returns the studentList
.public static
method named removeStudents
which clears our studentList
.static initialization block
immediately below your studentList
declaration.static { // static initializer
String[] studentNames = { "Karen", "Liel", "Quinn", "Destiny", "Blesson", "Danielle B.", "Andre", "Jeff",
"Carlo", "Julia D.", "Natalie", "Julia E.", "Shylee", "Genevieve", "Margo", "Whitney", "Rachel",
"Bridget", "Seung", "Jessica", "Harry", "Kesler", "Darin", "Jade", "Dominika", "Nashae", "Brianna",
"Laurent", "Rina", "Emily", "Elisha", "Caitlin", "Kierra", "Dana", "Alyssa", "Humaira", "Prajwal",
"Cristine", "Brendan" };
for (String studentName : studentNames) {
Student student = new Student(studentName);
studentList.add(student);
}
}
-
TechConnect
Create a TestTechConnect
class.
Create a method named setup
which is annotated with @Before
, takes has no parameters, and returns void
.
.removeStudents
method on TechConnect
Create a testRemoveStudents
method which ensures that our studentList
in our TechConnect
class isEmpty
upon invokation.
Create a testRecruitStudent
method which ensures that our studentList
is populated with respective Student
objects.
-
ClassRoom
ClassClassRoom
class.
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.ArrayList
of Student
objects named students
by invoking the getStudents
method on the TechConnect
class.ArrayList
of Instructor
objects named instructors
by invoking the getInstructor
method on the ZipCodeWilmington
class.-
ClassRoom
TestClassRoom
class.
HashMapping
returned by getRoster
, returns a valueSet
containing each of the Person
objects in ZipCodeWilmington
's instructorList
and TechConnect
's studentList
.