|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectStudent
public class Student
Class that describes a student. A student has a name and an array of grades. You can get information about a student such as her/his name and grade average.
Constructor Summary | |
---|---|
Student()
No argument constructor. |
|
Student(String theName)
Constructor that takes the name |
|
Student(String theName,
double[] theGradeArray)
Constructor that takes the name and an array of grades |
Method Summary | |
---|---|
double |
getAverage()
Method to return the average of the grades for this student |
double |
getGrade(int index)
Method to get the grade in the grade array at the passed index |
String |
getName()
Method to return the name of this student |
static void |
main(String[] args)
|
boolean |
setGrade(int index,
double newGrade)
Method to set a grade at an index |
boolean |
setGradeArray(double[] theArray)
Method to replace the array of grades |
boolean |
setName(String theName)
Method to set the name for this student |
String |
toString()
Method to return a string with information about this student |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Student()
public Student(String theName)
theName
- the student's namepublic Student(String theName, double[] theGradeArray)
theName
- the student's nametheGradeArray
- the array of gradesMethod Detail |
---|
public String getName()
public boolean setName(String theName)
theName
- the new name to use
public double getGrade(int index)
index
- the index that we want the grade for
public boolean setGradeArray(double[] theArray)
theArray
- the new array of grades to use
public boolean setGrade(int index, double newGrade)
index
- the index to set it atnewGrade
- the grade to use
public double getAverage()
public String toString()
toString
in class Object
public static void main(String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |