Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

public class Student implements comparable private String name private double gp

ID: 3742612 • Letter: P

Question

public class Student implements comparable private String name private double gpa-0 private int units- 0 publie Student (String name) tis. nane name ; public Student (String name, int units, double gpa) this.nane name this.units units; this.gpa -gpa public String getNane() return name public double gpa) return gpai public void setGPA (double newGPA) gpa- nevGPA; publie int units) return unitsi publie void setUnits(int newUnits) units newUnits; public int compareTo(Student other) double difference gpa other-gpa if (difference0) eturn 0 if(difference > 0) return 12; return-14;

Explanation / Answer

Following is the code of maxHeap: