Question: public class Student { private static final int NUM _ EXAMS = 4 ; private String firstName; private String lastName; private int gradeLevel; private double

public class Student
{
private static final int NUM_EXAMS =4;
private String firstName;
private String lastName;
private int gradeLevel;
private double gpa;
private int[] exams;
private int numExamsTaken;
// Constructor
public Student(String fName, String lName, int grade)
{
firstName = fName;
lastName = lName;
gradeLevel = grade;
exams = new int[NUM_EXAMS];
numExamsTaken =0;
}
// Implement this method!
// Returns the sum of the differences between exams
// Example: Assume exams ={54,67,89,95}
// Improvement =(67-54)+(89-67)+(95-89)=41
public int getExamImprovement()
{
// your code goes here!
}
public String getName()
{
return firstName +""+ lastName;
}
public void addExamScore(int score)
{
exams[numExamsTaken]= score;
numExamsTaken++;
}
// This is a setter method to set the GPA for the Student.
public void setGPA(double theGPA)
{
gpa = theGPA;
}
/**
* This is a toString for the Student class. It returns a String
* representation of the object, which includes the fields
* in that object.
*/
public String toString()
{
return firstName +""+ lastName +" is in grade: "+ gradeLevel;
}
}

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!