Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Person Class Reference

#include <person.h>

Inheritance diagram for Person:

UStudent GStudent List of all members.

Public Member Functions

 Person ()
 Person (string name, string ssn)
void setName (string name)
void setSSN (string ssn)
string getName ()
string getSSN ()
virtual void print (ostream &out=cout)
virtual void read (ifstream &fin)
virtual ~Person ()

Protected Attributes

string name
string ssn

Detailed Description

Person class for storing information about persons, each of which have a name and a social security number (ssn).

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


Constructor & Destructor Documentation

Person::Person  ) 
 

Default constructor.

Person::Person string  name,
string  ssn
 

Explicit class constructor initializing a person object using the arguments name and ssn (social security number).

Parameters:
name a string storing the name of this person
ssn a string storing the ssn (social security number) of this person

Person::~Person  )  [virtual]
 

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


Member Function Documentation

string Person::getName  ) 
 

Returns this person's name

Returns:
a string storing this person's name

string Person::getSSN  ) 
 

Returns this person's social security number (ssn)

Returns:
a string storing this person's ssn

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

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

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

Reimplemented in GStudent, and UStudent.

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

Reads this person's name and ssn (social security number) from the ifstream argument, storing them in the respective data members.

Parameters:
fin an ifstream for reading

Reimplemented in GStudent, and UStudent.

void Person::setName string  name  ) 
 

Sets this person's name

Parameters:
name a string storing this person's name

void Person::setSSN string  ssn  ) 
 

Sets this person's ssn (social security number)

Parameters:
ssn a string storing this person's ssn


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