Student Class Reference

#include <student.h>

List of all members.

Public Member Functions

 Student ()
void setName (string name)
void setMajor (string major)
void setLevel (string level)
void setDate (Date date)
string getName () const
string getMajor () const
string getLevel () const
Date getDate () const
bool operator< (const Student &student) const
bool operator> (const Student &student) const
void read (istream &in)
void write (ostream &out) const

Private Member Functions

double getPriority () const

Private Attributes

string name
string major
string level
Date date

Friends

ostream & operator<< (ostream &out, const Student &student)
istream & operator>> (istream &in, Student &student)

Detailed Description

A class for storing information about a student who is on a wait list for an unspecified course. Student have names, majors, levels, and the dates they appear on the wait list.

Author:
Mark Maloof (maloof@cs)
Version:
1.0, 01/19/11

Constructor & Destructor Documentation

Student::Student (  ) 

Default constructor. Sets the major to "COSC" and the level to "FY". The name and date objects keep their default values.


Member Function Documentation

Date Student::getDate (  )  const

Returns the date of this student.

Returns:
the date of this student
string Student::getLevel (  )  const

Returns the level of this student.

Returns:
the level of this student
string Student::getMajor (  )  const

Returns the major of this student.

Returns:
the major of this student
string Student::getName (  )  const

Returns the name of this student.

Returns:
the name of this student
double Student::getPriority (  )  const [private]

Gets the priority of this student on the wait list. Students with higher levels have higher priority. Students majoring in computer science have higher priority.

Returns:
a double indicating the priority
bool Student::operator< ( const Student student  )  const

Returns true if this student has a higher priority than the specified student; returns false otherwise. Takes into account the students' levels, majors, and dates they joined the wait list.

Parameters:
student the specified student
Returns:
a bool indicating whether this student has higher priority
bool Student::operator> ( const Student student  )  const

Returns true if this student has a lower priority than the specified student; returns false otherwise. Takes into account the students' levels, majors, and dates they joined the wait list.

Parameters:
student the specified student
Returns:
a bool indicating whether this student has lower priority
void Student::read ( istream &  in  ) 

Reads a student from the specified input stream. The format of a student consists of its name between double quotes, major, level, and date.

Parameters:
in the input stream for reading
void Student::setDate ( Date  date  ) 

Sets the date this student joined the wait list.

Parameters:
date the specified date of this student.
void Student::setLevel ( string  level  ) 

Sets the level of this student, which must be FY, SO, JR, or SR. Fails silently if the specified level is invalid.

Parameters:
level the specified level of this student.
void Student::setMajor ( string  major  ) 

Sets the major of this student, which must have four letters. Fails silently if the specified major is invalid.

Parameters:
major the specified major of this student.
void Student::setName ( string  name  ) 

Sets the name of this student.

Parameters:
name the specified name of this student.
void Student::write ( ostream &  out  )  const

Writes this student to the specified output stream.

Parameters:
out the specified output stream for writing

Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const Student student 
) [friend]

Inserts a Student object in the internal format into the output stream, and returns the modified output stream.

Parameters:
out the output stream for insertion
student the Student for insertion
Returns:
the modified output stream
istream& operator>> ( istream &  in,
Student student 
) [friend]

Extracts a Student from the input stream, and returns the modified input stream.

Parameters:
in the input stream for extraction
student the Student for storing the extracted information
Returns:
the modified input stream

Member Data Documentation

Date Student::date [private]

the date the student appeared on the wait list

string Student::level [private]

the student's class

string Student::major [private]

the student's major

string Student::name [private]

the student's name


The documentation for this class was generated from the following files:
Generated on Thu Jan 20 18:07:03 2011 by  doxygen 1.6.3