// CS2310 Project 2 Implementation file #include <iostream> #include <cstring> #include "Proj2_prototype.h" void SortedStuRecords::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. // Write your implementation here. } void SortedStuRecords::CalLetGrade() { // Postcondition: // Go through the array, calculate the letter grade for each student // by averaging the three numerical grades. // Write your implementation here. } void SortedStuRecords::PrintByGrades() const { // Postcondition: // Print out student records by the letter grades, with the records // of 'A' first, 'B' the second, ..., 'F' the last. // Write your implementation here. } void SortedStuRecords::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. // Write your implementation here. } SortedStuRecords::SortedStuRecords() { // Default constructor: Zero the length of the array. length = 0; } int main() { stuRecord recordTemp; // Step 1. Open the input file and read in student records // one by one, using recordTemp as the container. // After reading one record, call member function // InsertRecord to insert the record into the array. // So, you may use a loop like this: // // for (i=0; i<numStudents; i++) { // read a student record; // InsertRecord(recordTemp); // } // Step 2. Average student numerical grades and give the // letter grades. You can do this by calling // member function CalLetGrade. // Step 3. Print out student record in the order of letter // grades. You can do this by calling PrintByGrades. // Step 4. Print out student record in the order of ranks. // You can do this by calling PrintByRanks. }