// CS2310 Project 2 Specification file #define MAX_NUM_STUDENTS 15 #define MAX_NAME_LENGTH 15 #define LEN_SSN 10 enum letRank {Freshment, Sofomore, Junior, Senior}; enum letGrade {A, B, C, D, F}; struct stuRecord { char fstName[MAX_NAME_LENGTH]; char lstName[MAX_NAME_LENGTH]; char ssn[LEN_SSN]; letRank rank; char letGrade; int grades[3]; }; class SortedStuRecords { public: void InsertRecord(stuRecord& newRecord); // Precondition: // A new student record is passed in by newRecord. The student // records in the list are sorted in alphabetical order by // last names. // Postcondition: // The new record is inserted into the list at the proper // position. The resulting list is still ordered. length // variable is incremented. void CalLetGrade(); // Postcondition: // Go through the array, calculate the letter grade for each student // by averaging the three numerical grades. void PrintByGrades() const; // Postcondition: // Print out student records by the letter grades, with the records // of 'A' first, 'B' the second, ..., 'F' the last. void PrintByRanks() const; // Postcondition: // Print out student records by the ranks, with the records // of 'Freshmen' first, 'sophomore' the second, 'junior' the // third, and 'senior' the last. SortedStuRecords(); // Default constructor: Zero the length of the array. private: int length; // Keep track the number of students. stuRecord data[MAX_NUM_STUDENTS]; };