Institute
Posted: Sat May 14, 2022 4:46 pm
Institute <cinterface Person -name: string -arp 2000 Institute/name: string) +addPersonip : Person) +countUnder Graduate (s: double): int +getGraduate (n :int): Graduate +calculateScore(): double +getName(): string 4 Student -name: string #gpa: double Student name: string gpa : double) Graduate Undergraduate -nbPapers: int +Graduate name :string, gpa : double, nbPapers: int) getNbPapers(): Int +Undergraduate name : string. gpa : double) 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. Under Graduate class O METHODS: Under Graduate (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 Under Graduate 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. . QUESTION: Translate into Java code all the classes
Posted: Sat May 14, 2022 4:46 pm
Institute <cinterface Person -name: string -arp 2000 Institute/name: string) +addPersonip : Person) +countUnder Graduate (s: double): int +getGraduate (n :int): Graduate +calculateScore(): double +getName(): string 4 Student -name: string #gpa: double Student name: string gpa : double) Graduate Undergraduate -nbPapers: int +Graduate name :string, gpa : double, nbPapers: int) getNbPapers(): Int +Undergraduate name : string. gpa : double) 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. Under Graduate class O METHODS: Under Graduate (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 Under Graduate 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. . QUESTION: Translate into Java code all the classes