#include #include using namespace std; /******************************************************** * @Author: XXXXXXXXXXXX * * @version: 2 * * @Date: 02/10/2007 * * *Important Note: Gradebook file must be in correct * * *format to work for this program** * *********************************************************/ ifstream inFile; //Used for reading in Previous Gradebook files. ofstream outFile;//Used to create a Text file to store Gradebook information. int hSize = 0; // Number of Homework Grades int pSize = 0; // Number of Program Grades int eSize = 0; // Number of Exam Grades, must be less than or equal to two. int fSize = 0; // Tells whether the Final grade has been given or not. int *hArray; // int *pArray; // Arrays for storing grades while in program. int *eArray; // int Final; // The Final Grade. //+++++++++++++++++++Global Variables++++++++++++++++++++++++++++++ void readInGrades() {//Method to read grades from the Gradebook text file into the arrays. inFile>> hSize; inFile>> pSize; inFile>> eSize; inFile>> fSize; hArray = new int[hSize]; pArray = new int[pSize]; eArray = new int[eSize]; for( int x = 0; x < hSize; x++) { inFile>>hArray[x]; } for( int x = 0; x < pSize; x++) { inFile>>pArray[x]; } for( int x = 0; x < eSize; x++) { inFile>>eArray[x]; } } //FIX THIS void writeOutGrades() {//Method used to save Gradebook information into a text file. outFile<> choice; //Reads in User's choice. switch(choice) { int grade; case '1': cout<<"Homework grade: "<>grade; inputGrade(hArray, grade, hSize); hSize++; return 1; break; case '2': cout<<"Program grade: "<>grade; inputGrade(pArray, grade, pSize); pSize++; return 2; break; case '3': if(eSize < 2) { cout<<"Exam Grade: "<>grade; inputGrade(eArray,grade,eSize); eSize++; } else { cout<<"All Exam grades have been entered."<> Final; } else { cout<<"Final has already been entered."<"<