// ***************************************************************** // Author: Zhixiang Chen // Class: CSCI/CMPE 1170, Spring 2009 // Lab 20: Header file for Lab 20 // Date: January 12, 2009 // Comment: The code here is meant to be revised. // ***************************************************************** #include #include #include using namespace std; #ifndef LAB_20_HEAD_H #define LAB_20_HEAD_H /**************************************************************** This function gets class information from the input file and store the info to three parallel array and one two dim array. inFile: input file firstNames, lastNames, IDs: three output parallel arrays csci1370: two dim output array SIZE, COLUMN: two input parameters ****************************************************************/ void loadData(ifstream & inFile, string firstNames[], string lastNames[ ], string IDs[ ], double csci1370[][11], const int SIZE, const int COLUMN) { char str[1024]; //skip the first three lines inFile.getline(str, 1080, '\n'); cout<> firstNames[row] //get first name >> lastNames[row] //get last name >> IDs[row]; //get ID for (int col = 0; col > csci1370[row][col]; //get a row for csci1370 } } } /**************************************************************** This function computes scores for each student and decides his/her grade. The formula to calculate the scores of attendance 5%, quiz 5%, homework 30%, tests 60%. The grade is decided as follows: A if score >= 90, B if 80<= score <90, C if 70<= score < 80, D if 60 <= score <70, and F otherwise. ****************************************************************/ void grading(const double csci1370[][11], //input array double scores[], //output array for scores char grades[], //output array for grades const int SIZE, const int COLUMN) //input parameters { //your code is here } /**************************************************************** This function displays class information for CSCI 1370 in some nice format. ****************************************************************/ void showGrades(const string firstNames[], const string lastNames[], const string IDs[], const double csci1370[][11], const double scores[], const char grades[], const int SIZE, const int COLUMN) { //your code is here } #endif