type.lib
Class ITstudent

java.lang.Object
  extended by type.lib.Student
      extended by type.lib.ITstudent
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<java.lang.String>

public class ITstudent
extends Student

Provide services to maintain information about an IT (information technology) student. The class encapsulates the same information and functionality as Student except for three differences: the ID is auto-assigned serially (starting from 200105001 and ending at 200105999), the return of the toString method is prefixed by "IT", and the GPA is 10-based rather than 5-based; i.e. it is twice that of the Student class.

Version:
7.0 - Summer 2010
Author:
H. Roumani, roumani@cse.yorku.ca
See Also:
Serialized Form

Field Summary
 
Fields inherited from class type.lib.Student
rng
 
Constructor Summary
ITstudent(java.lang.String name)
          Create an IT student having the given name, and assigns it a serial 3-digit ID prefixed by "200105" and an empty (fresh) record.
 
Method Summary
 double getGpa()
          Determine the grade-point-average (GPA) of this student.
 java.lang.String toString()
          Return a string representation of this student.
 
Methods inherited from class type.lib.Student
equals, getCourseGrade, getFirstCourse, getID, getName, getNextCourse, getRandom, getRandom, hashCode, iterator, setCourseGrade, setSeed
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ITstudent

public ITstudent(java.lang.String name)
Create an IT student having the given name, and assigns it a serial 3-digit ID prefixed by "200105" and an empty (fresh) record.

Parameters:
name - the name of the IT student.
Method Detail

getGpa

public double getGpa()
Determine the grade-point-average (GPA) of this student. The GPA is computed based on twice the weights attached to grades in the Student class; i.e. they are out of 10, not 5.

Overrides:
getGpa in class Student
Returns:
the base-10 grade-point-average of this student.

toString

public java.lang.String toString()
Return a string representation of this student.

Overrides:
toString in class Student
Returns:
the string "IT student: " followed by the student's name.


Java by Abstraction: A Client-View Approach