public class Student
extends java.lang.Object
| Constructor and Description |
|---|
Student(java.lang.String firstName)
Student(String)
This constructor calls the designated constructor Student(String, String),
with the specified first name, and lastName = "LNU".
|
Student(java.lang.String firstName,
java.lang.String lastName)
Student(String, String)
This designated constructor sets the first and last name of the student.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changeName(java.lang.String firstName,
java.lang.String lastName)
changeName(String, String)
This instance method takes in two Strings as the first and last names.
|
static java.lang.String |
classStatistics()
classStatistics()
This class method returns the number of grades, sum of all grades, average grade,
lowest grade, and highest grade as one String.
|
static double |
getAverageGrade()
getAverageGrade()
This class method returns the average grade of all students.
|
int |
getGrade()
getGrade()
This instance method returns the student's grade.
|
static int |
getHighestGrade()
getHighestGrade()
This class method returns the highest grade of all students.
|
int |
getID()
getID()
This instance method returns the student ID.
|
static int |
getLowestGrade()
getLowestGrade()
This class method returns the lowest grade of all students.
|
java.lang.String |
getName()
getName()
This instance method returns the student's full name (first + last).
|
static int |
getNumberOfGrades()
getNumberOfGrades()
This class method returns the number of grades, in this case equivalent to the
number of students.
|
static int |
getTotalGrade()
getTotalGrade()
This class method returns the sum of all the grades.
|
void |
setGrade(int grade)
setGrade(int)
This instance method records (sets) the student's grade.
|
java.lang.String |
toString()
toString()
This instance method returns the name, SID, and grade of the student.
|
public Student(java.lang.String firstName,
java.lang.String lastName)
firstName - First name of the student as a String.lastName - Last name of the student as a String.public Student(java.lang.String firstName)
firstName - User-specified first name as a String.public void setGrade(int grade)
grade - The grade of the student as an Integer.public int getGrade()
public int getID()
public void changeName(java.lang.String firstName,
java.lang.String lastName)
firstName - Student's first name.lastName - Student's last name.public java.lang.String getName()
public static int getNumberOfGrades()
public static int getTotalGrade()
public static int getLowestGrade()
public static int getHighestGrade()
public static double getAverageGrade()
public static java.lang.String classStatistics()
public java.lang.String toString()
toString in class java.lang.Object