|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectStudent
public class Student
A class for managing the grades of a student
| Constructor Summary | |
|---|---|
Student()
Constructor for creating an anonymous student |
|
Student(java.lang.String name)
Constructor for creating a student with the given name |
|
| Method Summary | |
|---|---|
void |
addGrade(double newGrade)
Method to add a new grade at the end of the grade list |
double |
average()
Method to return the average of the student's grades |
double |
getGrade(int whichScore)
Method to fetch the indicated score for the student |
int |
getNumScores()
Method to fetch the number of scores entered for the student |
void |
setGrade(int whichScore,
double grade)
Method to set the indicated score for the student |
java.lang.String |
toString()
Override toString for the Student class |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Student()
public Student(java.lang.String name)
name - the name for the new student| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Object
public void addGrade(double newGrade)
throws GradeException
newGrade - the grade to add
GradeException - if grades array is fullpublic int getNumScores()
public double average()
public double getGrade(int whichScore)
throws GradeException
whichScore, - the number of the score to fetch
GradeException - if whichScore is out of range
public void setGrade(int whichScore,
double grade)
throws GradeException
whichScore, - the number of the score to setgrade - the value to which to set the score
GradeException - if whichScore is out of range
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||