Class SuffolkResident

java.lang.Object
  extended by Student
      extended by SuffolkResident
All Implemented Interfaces:
Tuition

public final class SuffolkResident
extends Student
implements Tuition

The SuffolkResident class definition which manages student tuition field.

Version:
Copyright 2002 (c) SCCC West
Author:
Carl B. Struck

Field Summary
 
Fields inherited from interface
FT_TUITION, PT_TUITION
 
Constructor Summary
SuffolkResident(java.lang.String firstName, java.lang.String lastName, java.lang.String grade, int credits)
          The constructor sets initial value for the student tuition field.
 
Method Summary
 int getTuition()
          Returns the student's semester tuition field as an int value.
 java.lang.String getTuitionString()
          Returns the formatted semester tuition field with a label as a String.
 void setTuition()
          Sets the semester tuition for a student based on number of credits.
 
Methods inherited from class
getCredits, getFirstName, getGrade, getLastName, setCredits, setFirstName, setGrade, setLastName, setStudent, toString
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuffolkResident

public SuffolkResident(java.lang.String firstName,
                       java.lang.String lastName,
                       java.lang.String grade,
                       int credits)
The constructor sets initial value for the student tuition field. Explicit call to superclass Student constructor sets initial values for the student first name, last name, grade and credits fields.

Parameters:
firstName - the student's first name
lastName - the student's last name
grade - the student's letter grade
credits - the number of credits carried by the student
Method Detail

getTuition

public int getTuition()
Returns the student's semester tuition field as an int value. This method must be implemented because the class SuffolkResident implements the Tuition interface which defines the abstract getTuition() method.

Specified by:
getTuition in interface Tuition
Returns:
student's tuition

getTuitionString

public java.lang.String getTuitionString()
Returns the formatted semester tuition field with a label as a String. This method must be implemented because the class SuffolkResident extends the Student class which defines the abstract getTuitionString() method.

Specified by:
getTuitionString in class Student
Returns:
formatted tuition field with label as a String.

setTuition

public void setTuition()
Sets the semester tuition for a student based on number of credits. If credits from superclass Student are less than 12, multiply credits by the part-time tuition rate; otherwise tuition is set to the flat full-time rate. This method must be implemented because the class SuffolkResident implements the Tuition interface which defines the abstract setTuition() method.

Specified by:
setTuition in interface Tuition