The code is designed to output a student roster, and enable the sorting of the table by first name, last name, grade, among others.
My program compiles and I actually get credit for the first few problems, however it seems I am having trouble with my SortByFirstName and SortByLastName functions, or the way those functions interact with SortByGrade. (these functions are at the bottom of the code, everything else should work fine)
When attempting to sort by last name or by first, the output comes out nearly correct, that is, the list appears to be sorted properly but then two of the middle names are unsorted. The grade values are also improperly swapped (or not swapped at all?).
When just sorting by grade there appears to be no problem, so Im assuming the error lies in the SortByFirstName and SortByLastName functions.
Heres an example error output for my current code (for SortByFirstName):
Expected: | | Found:
- Alyx Masinas | | Alyx Masinas
- Ginnie McDonald | | Nola Manon
- Nola Manon | | Ginnie McDonald
- Randy Rubin | | Randy Rubin
- Sephora McDonald | | Sephora McDonald
Heres another (for SortByFirstName + SortByGrade):
Expected: | | Found:
- Alyx Masinas | | Alyx Masinas
- Ginnie McDonald | | Nola Manon
- Nola Manon | | Ginnie McDonald
- Randy Rubin | | Randy Rubin
- Sephora McDonald | | Sephora McDonald
Expected: | | Found:
- 83.5 | | 83.5
- 98.7 | | 100
- 100 | | 98.7
- 89.5 | | 89.5
- 100 | | 100
Why are my functions not sorting properly? After finally getting it to all compile I don't know where to go. Ive been looking in my notes for similar practice problems where the vector was not fully selected during a function call. Any help would be appreciated, thank you.