Question: Interface Person: o METHODS: calculateScore (): calculated as: for Graduate : Score = nbPapers * gpa for UnderGraduate: Score = gpa * 3 + 5
Interface Person:
o METHODS:
calculateScore (): calculated as:
for Graduate : Score = nbPapers * gpa
for UnderGraduate: Score = gpa * 3 + 5
getName (): returns the name of the student.
Student class
o METHODS:
Student (name: String, gpa : double): constructor.
Graduate class
o METHODS:
Graduate (name: String, gpa : double, nbPpapers : int): constructor. getNbPapers(): getter for attribute nbPapers.
UnderGraduate class
o METHODS:
UnderGraduate (name: String, gpa : double): constructor.
Institute class
o METHODS:
Institute(name: String): constructor.
addPerson(p: Person): add a person to the institute.
countUnderGraduate (s : double): count the number of UnderGraduate in
the institute with score grater or equal to s.
getGraduate (n : int): this method will return an array containing all the
Graduate with number of papers greater than n.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
