Tracking student information
The incomplete class StudentInfo is used to keep track
of a student's records. It contains the name, hours taken, and
grade points earned by the student. The class calculates the GPA
of the student and determines if the student is a senior. Other
member functions are not shown.
Directions:
getName, getCreditHours, and getGradePoints.
computeGPA method. The computeGPA
method computes the student's grade point average by dividing grade
points by the credit hours. The GPA for a student with 0 credit
hours should be set to 0.
isSenior method. The isSenior
method returns true if the given student has at least
125 credit hours and has a GPA of at least 2.0; otherwise,
isSenior returns false.
public class StudentInfo {
// fields
private String myName;
private int myCreditHours;
private double myGradePoints;
// constructor
public StudentInfo(String name, int creditHours, double gradePoints) {
}
//accessors
public String getName() {
}
public int getCreditHours() {
}
public double getGradePoints() {
}
public double computeGPA() {
}
public boolean isSenior() {
}
public String toString( ) {
}
// other modifiers here ...
}
public class StudentInfoTest {
public static void main (String[] args) {
}
}