Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Students Class Reference

#include <students.h>

List of all members.

Public Member Functions

 Students ()
 Students (string filename)
void print (ostream &out=cout)
bool read (string filename)
double getAvgGPA ()
 ~Students ()


Detailed Description

The Students class, derived through private inheritance from the vector class, stores information about undergraduate and graduate students. The vector stores pointers to these objects, and provides methods for destructing, reading, printing, and averaging the GPAs of such objects.

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


Constructor & Destructor Documentation

Students::Students  ) 
 

Default class constructor.

Students::Students string  filename  ) 
 

Explicit class constructor initializing this students class using the information in the file filename.

Parameters:
filename a string containing the name of the file to be read

Students::~Students  ) 
 

Class destructor.


Member Function Documentation

double Students::getAvgGPA  ) 
 

Returns the average of the GPAs of the students stored in the vector.

Returns:
a double storing the average GPA of the students stored

void Students::print ostream &  out = cout  ) 
 

Prints to the ostream out this object's students, their names, social security numbers, majors, grade-point averages, and, for graduate students, their degrees. The ostream defaults to cout.

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

bool Students::read string  filename  ) 
 

Reads students from the file named filename and stores them in a vector. Undergraduate students are marked with a 'U', graduate students, with a 'G'. If the file is opened successfully, then the method returns true; otherwise, it returns false;

Parameters:
filename a string containing the name of the file to read
Returns:
a bool indicating whether the file successfully opened


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