// CS2310 Project 3 Specification file #include #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}; class StuRecord { public: // The following is just a list of functions // suggested to be implemented. You may insert // more functions whenever necessary. StuRecord(/* parameter list */) // Constructor void Initialize(/* parameter list */) // Initialize this record. String GetfstName(); // An observor that returns the first name. String GetlstName(); // An observor that returns the last name. letRank GetletRank(); // An observor that returns the rank. letGrade GetletGrade(); // An observor that returns the letter grade. void PrintRecord(/* parameter list */) // Print out this record in proper format void CalLetGrade(/* parameter list */) // Calculate the letter grade of this // student. private: String fstName[MAX_NAME_LENGTH]; String lstName[MAX_NAME_LENGTH]; String ssn[LEN_SSN]; letRank rank; letGrade 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. // Hint: consider how to use the member function // initialize of StuRecord class to set up // the record. void CalLetGrade(); // Postcondition: // Go through the array, calculate the letter grade for each student // by averaging the three numerical grades. // Hint: consider how to use member function // CalLetGrade of StuRecord class. void PrintByGrades() const; // Postcondition: // Print out student records by the letter grades, with the records // of 'A' first, 'B' the second, ..., 'F' the last. // Hint: consider how to use the PrintRecord // member function of StuRecord class. 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. // Hint: consider how to use the PrintRecord // member function of StuRecord class. SortedStuRecords(); // Default constructor: Zero the length of the array. private: int length; // Keep track the number of students. StuRecord data[MAX_NUM_STUDENTS]; };