Question: Given the following class definition write the code for the method getGPA() and the javaDocs that explain what the method does and how GPA is

Given the following class definition write the code for the method getGPA() and the javaDocs that explain what the method does and how GPA is calculated:

public class Student { private int studentID; private String name; private Schedule schedule; private int gradePoints; private int numberOfCredits; public student(String name, int ID) { this.name = name ; studentID = ID; } public double getGPA() { // <<< your code goes here >>> } private double calculateGPA() { // (double) in the next line of code 'casts' (forces) gradePoints to be a type double in this line // of code so that the division will return a real number instead of an int double gradePointAverage = (double)gradePoints/numberOfCredits; return gradePointAverage; } // more code }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!