Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following class definition: public class Student { private int studentID; private String name; private Schedule schedule; private int gradePoints; private int numberOfCredits; public
Given the following class definition:
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 from previous question >>> } 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 }
You are now working in a new class called Registrar and the following code hsa been written. Complete the line of code calculating the average GPA and
write the javaDocs that explains what the method does and private documentation explaining how the method works
public class Registrar { // some more fields here // a constructor here // some methods here public double calculateAverageGPA( Student student1, Student student2, Student student3) { // <<< your code here >>> } // more methods }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started