Git-Leon ea5fb85ff4 Update README.md | 7 years ago | |
---|---|---|
src | 7 years ago | |
.gitignore | 7 years ago | |
.project | 7 years ago | |
README.md | 7 years ago | |
pom.xml | 7 years ago |
Person
ClassPerson
class.
final
field named id
of type long
.Person
constructor should have a parameter of type long
which sets the id
field to the respective value.getId()
method which returns the Person
object's id
field.getName()
method which returns the Person
object's name
field.setName()
method which sets the Person
object's name
field.-
Person
TestPerson
class.
testConstructor
method which ensures that a Person
object's id
field is being set upon construction.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
.-
People
classPeople
class.
ArrayList
field of Person
objects named personList
.add
which adds a Person
to the personList
.findById
which makes use of a long id
parameter to return a Person
object with the respective id
field.remove
which makes use of a Person person
parameter to remove a respective Person
object.remove
which makes use of a long id
parameter to remove a Person
object with the respective id
field.getCount
which returns the size of oersonList
.getArray
which returns an array representation of the personList
field.removeAll
which clears our personList
field.
-
People
TestPeople
class.
testAdd
method which ensures that our personList
in our People
class populated with respective Student
objects following invokation of the addStudent
method.testRemove
method which ensures that the personList
in a People
object is depopulated with a respective Person
object following the invokation of the remove
method.testFindById
method which ensures that a respective Person
object with a respective id
field is returned upon invokation of the findById
method on a respective People
object.-
MyCohort
singletonMyCohort
class.
People
class.final
field named INSTANCE
of type MyCohort
.INSTANCE
field with respective Student
representations of your colleagues.
id
field.getInstance
method which returns the INSTANCE
field.
-
MyCohort
singletonTestMyCohort
class.
test
method which ensures that each of the students in your current cohort are in your MyCohort
singleton.-
ZipCodeInstructors
singletonPart 7.0
and Part 7.1
as a reference.ZipCodeInstructors
singleton which represents the set of instructors at ZipCodeWilmington.TestZipCodeInstructors
class.-
ZipCodeWilmington
ClassPart 7
as a reference.ZipCodeWilmington
singleton.
MyCohort
called cohort
.ZipCodeInstructors
called instructors
.hostLecture
which makes use of a long id, double numberOfHours
parameter to identify a respective Instructor
to host a lecture
to the composite people
field in the cohort
reference.-
ZipCodeWilmington
TestZipCodeWilmington
class.
testHostLecture
method which ensures that each of the Student
's totalStudyTime
instance variable is incremented by the specified numberOfHours
upon invoking the .hostLecture
method.