Main Page   Class Hierarchy   Compound List   File List   Compound Members  

UStudent Class Reference

#include <ustudent.h>

Inheritance diagram for UStudent:

Person GStudent List of all members.

Public Member Functions

 UStudent ()
 UStudent (string name, string ssn, string major, double gpa)
void setMajor (string major)
void setGPA (double gpa)
string getMajor ()
double getGPA ()
virtual void read (ifstream &fin)
virtual void print (ostream &out=cout)
virtual ~UStudent ()

Protected Attributes

string major
double gpa

Detailed Description

UStudent class, publically derived from the Person class, for storing information about undergraduate students. Such students have majors and GPAs in addition to the name and ssn (social security number) they inherit from the Person class.

Author:
Mark Maloof
Version:
1.0 1/27/04


Constructor & Destructor Documentation

UStudent::UStudent  ) 
 

Default class constructor.

UStudent::UStudent string  name,
string  ssn,
string  major,
double  gpa
 

Explicit class constructor initializing this undergraduate-student object using the arguments name, ssn (social security number), major, and gpa (grade-point average)

Parameters:
name a string storing this student's name
ssn a string containing this student's ssn (social security number)
major a string storing this student's major
gpa a double storing this student's gpa (grade-point average)

UStudent::~UStudent  )  [virtual]
 

Destructor. Does nothing but is recommended for classes with virtual methods.


Member Function Documentation

double UStudent::getGPA  ) 
 

Returns this student's gpa (grade-point average).

Returns:
a double storing this student's gpa

string UStudent::getMajor  ) 
 

Returns this student's major.

Returns:
a string storing this student's major

void UStudent::print ostream &  out = cout  )  [virtual]
 

Prints this student's name, ssn, major, and gpa to the ostream out, which defaults to cout.

Parameters:
out an ostream for printing (defaults to cout)

Reimplemented from Person.

Reimplemented in GStudent.

void UStudent::read ifstream &  fin  )  [virtual]
 

Reads this student's name, ssn, major, and gpa from the ifstream argument

Parameters:
fin an ifstream for reading

Reimplemented from Person.

Reimplemented in GStudent.

void UStudent::setGPA double  gpa  ) 
 

Sets this student's GPA (grade-point average)

Parameters:
gpa a double storing this student's gpa (grade-point average), which must be in the range [0.0, 4.0]

void UStudent::setMajor string  major  ) 
 

Sets this student's major

Parameters:
major a string storing this student's major


The documentation for this class was generated from the following files:
Generated on Fri Feb 6 16:29:56 2004 by doxygen1.3