Class Student

java.lang.Object
  extended byPerson
      extended byStudent
All Implemented Interfaces:
java.io.Serializable

public class Student
extends Person
implements java.io.Serializable

Since:
JDK 1.4
Version:
1.0
Author:
Joseph deGuzman
See Also:
Person, Serialized Form

Field Summary
static int FIRST_PROB
          Sets the student in First Probationary Status.
static int REGULAR
          Sets the student in Regular Status.
static int SECOND_PROB
          Sets the student in Second Probationary Status.
static int SHIFT
          Sets the student to be advice/forced to shift.
 
Constructor Summary
Student()
          Creates a student object with no name, a generated ID Number and Regular probationary status.
Student(Person thisPerson)
          Creates a student with full name and a generated ID Number
Student(java.lang.String first, java.lang.String last, java.lang.String mid)
          Creates a student object with first, last and middle names.
Student(java.lang.String first, java.lang.String last, java.lang.String mid, int yr, java.lang.String crs)
          Creates a student object with first, last and middle names.
 
Method Summary
 void addSubject(Subject thisSubj)
          Adds/Enrolls the student to a subject.
 void dropSubject(java.lang.String thisCode)
          Drops/Withdraws the student to a subject.
static int getCount()
          Gets the total number of Student objects created.
 java.lang.String getCourse()
          Gets the course that this object is currently enrolled to.
 java.lang.String getIdNumber()
          Gets the Student's ID Number.
 double getMSCA()
          Computes and returns the Student's MSCA.
 int getProbationStatus()
          Returns the Student's probation status code.
 java.lang.String getStat()
          Returns the Student's probation status in words
 java.util.Hashtable getSubjects()
          Returns the Hashtable of subjects that the Student has enrolled.
 double getWPA()
          Computes and returns the Student's WPA.
 int getYear()
          Returns the Student's year level.
 void setCourse(java.lang.String course)
          Sets a new course for the Student.
static void setInitialCount(int newCount)
          Sets and initial value of how many Students has been previously created.
 void setNewId(java.lang.String thisNew)
          Sets a new ID Number for the student created.
 void setProbationStatus(int stat)
          Sets the student's probationary status code and code equivalent (stat).
 void setStat(java.lang.String thisNewStat)
          Sets a user-defined Probationary status without using Status codes.
 void setYear(int year)
          Sets the Student's year level
 java.lang.String toString()
          Returns Student Informations.
 
Methods inherited from class Person
getFirstName, getLastName, getMiddleInitial, getMiddleName, setCount, setFirstName, setLastName, setMiddleInitial, setMiddleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REGULAR

public static final int REGULAR
Sets the student in Regular Status.

See Also:
Constant Field Values

FIRST_PROB

public static final int FIRST_PROB
Sets the student in First Probationary Status.

See Also:
Constant Field Values

SECOND_PROB

public static final int SECOND_PROB
Sets the student in Second Probationary Status.

See Also:
Constant Field Values

SHIFT

public static final int SHIFT
Sets the student to be advice/forced to shift.

See Also:
Constant Field Values
Constructor Detail

Student

public Student()
Creates a student object with no name, a generated ID Number and Regular probationary status.


Student

public Student(Person thisPerson)
Creates a student with full name and a generated ID Number

Parameters:
thisPerson - a Person object

Student

public Student(java.lang.String first,
               java.lang.String last,
               java.lang.String mid)
Creates a student object with first, last and middle names.

Parameters:
first - person first name.
last - person last name.
mid - person middle name.

Student

public Student(java.lang.String first,
               java.lang.String last,
               java.lang.String mid,
               int yr,
               java.lang.String crs)
Creates a student object with first, last and middle names. Also sets student's year and course.

Parameters:
first - person first name.
last - person last name.
mid - person middle name.
yr - student year level.
crs - student course.
Method Detail

addSubject

public void addSubject(Subject thisSubj)
Adds/Enrolls the student to a subject.

Parameters:
thisSubj - The Subject that the student is wished to be enrolled to.

dropSubject

public void dropSubject(java.lang.String thisCode)
Drops/Withdraws the student to a subject.

Parameters:
thisCode - The Subject code that the student is wished to be dropped.

getCount

public static int getCount()
Gets the total number of Student objects created.

Returns:
count Objects created.

getCourse

public java.lang.String getCourse()
Gets the course that this object is currently enrolled to.

Returns:
course The Student's course.

getIdNumber

public java.lang.String getIdNumber()
Gets the Student's ID Number.

Returns:
IdNumber Student ID Number.

getProbationStatus

public int getProbationStatus()
Returns the Student's probation status code.

Returns:
ProbationStatus Probation Status Code.

getStat

public java.lang.String getStat()
Returns the Student's probation status in words


getSubjects

public java.util.Hashtable getSubjects()
Returns the Hashtable of subjects that the Student has enrolled.

Returns:
Hashtable/Collection of enrolled subjects.

getWPA

public double getWPA()
Computes and returns the Student's WPA.

Returns:
Student's Weighted Percentile Average (WPA).

getMSCA

public double getMSCA()
Computes and returns the Student's MSCA.

Returns:
Student's Major Subjects Calculated Average (MSCA).

getYear

public int getYear()
Returns the Student's year level.

Returns:
Student Year Level

setCourse

public void setCourse(java.lang.String course)
Sets a new course for the Student.

Parameters:
course - the Student Course.

setInitialCount

public static void setInitialCount(int newCount)
Sets and initial value of how many Students has been previously created.

Parameters:
newCount - New initial count.

setNewId

public void setNewId(java.lang.String thisNew)
Sets a new ID Number for the student created.

Parameters:
thisNew - The new ID Number to be initialized.

setProbationStatus

public void setProbationStatus(int stat)
Sets the student's probationary status code and code equivalent (stat).

Parameters:
stat - Probationary Status (REGULAR,FIRST_PROB, SECOND_PROB, or SHIFT)

setStat

public void setStat(java.lang.String thisNewStat)
Sets a user-defined Probationary status without using Status codes.

Parameters:
thisNewStat - New Probationary Status

setYear

public void setYear(int year)
Sets the Student's year level

Parameters:
year - New year level

toString

public java.lang.String toString()
Returns Student Informations.

Returns:
Student ID Number and full name.