Student Class Reference
#include <student.h>
List of all members.
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
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
the date the student appeared on the wait list
The documentation for this class was generated from the following files: