/**************************************************************** PROGRAM: Project 1 AUTHOR: Anthony Hogan LOGON ID: Z109079 DUE DATE: 1/26/2009 FUNCTION: creates a program that enables a user to input student data. Including name, zid, SSN, and courses. INPUT: from keyboard OUTPUT: A list of all courses taken/schedules for a certain student. NOTES: Uses 6 files. Student.h, Student.cpp, Person.h, Person.cpp, courseInfo.h, courseInfo.cpp, and 340.h. ****************************************************************/ #include "Person.h" #include "Student.h" #include "courseInfo.h" #include "340.h" int main() { int choice = 0; Student NIU_Student; //creates a student object while (choice != 999) { cout << "\nStudent Registration Database" << endl; cout << "Please choose from the options below (type 999 to quit)\n" << endl; cout << "0. Select this to read in from file" << endl; cout << "1. Enter new student information" << endl; cout << "2. Enter new class information for student" << endl; cout << "3. Edit student information (not valid)" << endl; cout << "4. Edit class information for student (not valid)" << endl; cout << "5. Print student information\n" << endl; cout << "Please enter your choice: (the press enter, 999 to quit)"; cin >> choice; switch(choice) { case 0: { ifstream inFile; string fileName; cout << "Please enter name of file to read in: " << endl; cin >> fileName; inFile.open("fileName"); //opens file if (!inFile) { cout << "\nThe input file does not exist!" << endl; return 1; } string value; inFile >> value; NIU_Student.setFirstName(value); inFile >> value; NIU_Student.setLastName(value); inFile >> value; NIU_Student.setSSN(value); inFile >> value; NIU_Student.setDOB(value); inFile >> value; NIU_Student.setGender(value); inFile >> value; NIU_Student.setZID(value); while (inFile) { //read in class info (courseName, courseYear, courseSemester, courseGrade) // be able to read in as many as needed - and add them to the linked list set up in Student.h } break; } case 1: { string x; cout << "Please enter the first name: "; cin >> x; NIU_Student.setFirstName(x); cout << "Please enter the last name: "; cin >> x; NIU_Student.setLastName(x); cout << "Please enter students social security number: "; cin >> x; NIU_Student.setSSN(x); cout << "Please enter student DoB: "; cin >> x; NIU_Student.setDOB(x); cout << "Please enter the student's gender: "; cin >> x; NIU_Student.setGender(x); cout << "Please enter students ZID: "; cin >> x; NIU_Student.setZID(x); break; } case 2: { //string entry, // more; /* do { cout << "Please enter course name: "; cin >> entry; NIU_Student.courses[NIU_Student.getCount()].setCourseID(entry); cout << "Please enter year taken: "; cin >> entry; NIU_Student.courses[NIU_Student.getCount()].setYearTaken(entry); cout << "Please enter semester taken: "; cin >> entry; NIU_Student.courses[NIU_Student.getCount()].setSemesterTaken(entry); cout << "Please enter grade for course: "; cin >> entry; NIU_Student.courses[NIU_Student.getCount()].setGrade(entry); cout << "Enter another class? (Y/N): "; cin >> more; NIU_Student.incrementCount(); } while (more == "Y" || more == "y"); */ break; } case 3: { cout << "Choice entered was 3" << endl; break; } case 4: { cout << "Choice entered was 4" << endl; break; } case 5: { NIU_Student.infoPrint(); break; } case 999: { cout << "Quitting..." << endl; break; } } // end of switch statement } // end of while return 0; }