#include "Student.h" /**************************************************************** FUNCTION: Student() ARGUMENTS: none RETURNS: none NOTES: this is the Student class constructor ****************************************************************/ Student::Student() { count = 0; } /**************************************************************** FUNCTION: ~Student() ARGUMENTS: none RETURNS: none NOTES: this is the destructor for the Student class ****************************************************************/ Student::~Student() { } /**************************************************************** FUNCTION: incrementCount() ARGUMENTS: none RETURNS: none NOTES: This function increments count so that the number of classes added are counted on entry ****************************************************************/ void Student::incrementCount() { count = count + 1; } /**************************************************************** FUNCTION: getZID() ARGUMENTS: none RETURNS: ZID - returns the students ZID number NOTES: This function simply returns the students ZID# ****************************************************************/ string Student::getZID() const { return ZID; } /**************************************************************** FUNCTION: setZID(const string &x) ARGUMENTS: string x RETURNS: none NOTES: this function sets the students ZID with the value passed to it. ****************************************************************/ void Student::setZID(string &x) { ZID = x; } /**************************************************************** FUNCTION: getCount() const ARGUMENTS: none RETURNS: int count NOTES: this function returns the count of the number of classes added to the students registration etc ****************************************************************/ int Student::getCount() const { return count; } /**************************************************************** FUNCTION: infoPrint() ARGUMENTS: none RETURNS: none NOTES: this prints the students information, including the basic information, aswell as class information ****************************************************************/ void Student::infoPrint() { cout << getFirstName() << " " << getLastName() << " " << getSSN() << " " << getDOB() << " " << getGender() << " " << getZID() << endl; //cout << courseList.nodeSLL->info; while (courseList.head->next != NULL) { cout << courseList.head->info.getCourseID() << courseList.head->info.getSemesterTaken() << courseList.head->info.getYearTaken() << courseList.head->info.getGrade() << endl; courseList.head = courseList.head->next; } /* int count = 0; while (count <= getCount()) { cout << setw(8) << courses[count].getCourseID() << " " << setw(5) << courses[count].getYearTaken() << " " << setw(7) << courses[count].getSemesterTaken() << " " << setw(3) << courses[count].getGrade() << endl; count++; } */ } void Student::loadInfoFromFile(fstream& inFile) { string firstName, lastName, SSN, DOB, gender, ZID, courseID, year, semester, grade; inFile >> firstName; Person::setFirstName(firstName); inFile >> lastName; Person::setLastName(lastName); inFile >> SSN; Person::setSSN(SSN); inFile >> DOB; Person::setDOB(DOB); inFile >> gender; Person::setGender(gender); inFile >> ZID; setZID(ZID); //start class read inFile >> courseID; while (inFile) { inFile >> year; inFile >> semester; inFile >> grade; cout << "Course ID: " << courseID << endl; cout << "Year: " << year << endl; cout << "Semester: " << semester << endl; cout << "Grade: " << grade << endl; CourseInfo courses; courses.setCourseID(courseID); courses.setYearTaken(year); courses.setSemesterTaken(semester); courses.setGrade(grade); addCourse(getZID(), courses); inFile >> courseID; } } void Student::addCourse(string ZID, const CourseInfo& c1) { cout << "IN ADD COURSE!!!" << endl; courseList.addToHead(c1); }