Question: can you rewrite the code in order to pass the failing tests? for sorting you must implement a selection sort. 8.10 Project 4 - Help

can you rewrite the code in order to pass the failing tests? for sorting you must implement a selection sort.
can you rewrite the code in order to pass the failing tests?
for sorting you must implement a selection sort. 8.10 Project 4 -
Help me Sort My Roster About The class roster program is working
really well. However, it would be nice to be able to sort
students based on first name, last name, or their grade. I would
like a program where I can choose how my roster is sorted
and then print out the class summary Specification have provided a template
main.cpp for you to edit e functions which have /*Provide Implementation are
for you to edit Note: You are not allowed to change any

8.10 Project 4 - Help me Sort My Roster About The class roster program is working really well. However, it would be nice to be able to sort students based on first name, last name, or their grade. I would like a program where I can choose how my roster is sorted and then print out the class summary Specification have provided a template main.cpp for you to edit e functions which have /*Provide Implementation are for you to edit Note: You are not allowed to change any of the function signature (be, add or edit parameter names and types, or change the function name or its return type) Note: For sorting you must implement a Selection Sort Note: If two elements are equal do not swap the elements SortByFirstName(vector students, vector grades) - option Sorts students and grades by the students first name SortByLostName(vector students vector grades) - option (lowercase Sorts students and grades by the students last name SortByGrade vector students, vector grades) option Sorts students and grades by the students grade You will nino need to add code which calls the functions if the user selecta to sort using that sort by function You can find it in the code by searching for provide toplementation for other menu options/ Unlike ont assignments which test matching output this antigament tests output along with testing your functions directly uning unit tests. The unit tests will use your functions with hardcoded vectors, if the testo file the unit tests will print out what it expected compared to what your function did when sorting. If you have any question please reach out via email, discussion board, or during office hours 1 #include 4 #include Igrades): 13 vold AddStudent vector 7/Print thank you message cout else if(selection - MENU PrintMeno: > else if(selection - SORT BY FIRST.NAME SortilyfirstName(students grades): 1 else if(selection - SORT BY LAST NAME Sortbylostone(students, grodes)! 1 else if(selection - SORT BY GRADE) SortilyGrode students grades) ) 1 else cout > numor Students; 96) 97 98 void PrintMenu 99 string menu "Please choose one of the following options: " 100 "ar add a student 10: "r: remove a student " 102 "p: print the class summary " I 103 "a print menu " 100 sort - First none 105 "L: sort - last namen 106 "G: sort - grade 107 *4 quit progra": 188 109 cout

> selection: 116 return selection 117) 118 void PrintSummary(const vector> firstNone last None > grade: students.push_back(firstName+ last None): 148 grades push backCarade): 149) 150 void RemoveStudent (vector> firstName> lastName>> grade students.push back(firstName" lastName); 148 grades.push_backgrode): 149) 150 void RemoveStudent (vector &grades) { 151 string removeStudent - Please enter students first and last none": 152 string firstName, lastName; 153 154 cout > firstNome >> Last Name 156 string fullName - firstName + lastNone; 157 for(int i = 0; i 184 ) 185 cout 183 3 184 185 cout Estudents, vector double agrades) { 188 cout string Inane temp. students [k].substr(students. Find first of C")1) if (none temp 210 if(grodes[K] grades[0]) 211 min. indki 212 ) 213 } 214 swap(students. Students[min_ind]); 215 swap Cgrades. grades[min ind]): 216 2 217) 218 196 197 199 Whenna nimwom the shit --- Only show falling tests (5 tests hidden) Download this submission 0/10 4: Test SortByFirstName Checking Students A Your output Sorting by first name Test feedback Expected: Found: Alyssa Massion Alyssa Massion Gussie McFadden Nala Mahon Nala Mahon Gussie McFadden Ricardo Romero Ricardo Romero Stephanie McFadden Stephanie McFadden 0/10 5. Test SortByFirstName - Checking Students and Grades a Your output Sorting by first name Expected studenta: Grades: Found Students: Grades: Alyssa Massion 83.5 Alyssa Massion 83.5 Gussie McFadden 98.7 Nala Mahon 100 Nala Mahon 100 Gussie McFaddon 98.7 Ricardo Romero 89.5 Ricardo Romero 89.5 Stephanie McFadden 100 Stephanie McFadden 100 Test feedback 6: Test SortByLastName - Checking Students 0/10 Your output Sorting by last name Test feedback Expected: Nala Mahon Alyssa Massion Gussie McFadden Stephanie McFadden Ricardo Romero Found: Stephanie McFadden Alyssa Massion Nala Mahon Gussie McFadden Ricardo Romero 7. Test SortByLastName - Checking Students and Grades a 0/10 Your output Sorting by last name Test feedback Expected Students: Grades: Found Students: Grades: Nala Mahon 100 Stephanie McFadden 89.5 Alyssa Massion 83.5 Alyssa Massion 98.7 Gussie MoFadden 98.7 Nala Mahon 100 Stephanie McFadden 100 Gussie McFadden 83.5 Ricardo Romero 89.5 Ricardo Romero 100 8.10 Project 4 - Help me Sort My Roster About The class roster program is working really well. However, it would be nice to be able to sort students based on first name, last name, or their grade. I would like a program where I can choose how my roster is sorted and then print out the class summary Specification have provided a template main.cpp for you to edit e functions which have /*Provide Implementation are for you to edit Note: You are not allowed to change any of the function signature (be, add or edit parameter names and types, or change the function name or its return type) Note: For sorting you must implement a Selection Sort Note: If two elements are equal do not swap the elements SortByFirstName(vector students, vector grades) - option Sorts students and grades by the students first name SortByLostName(vector students vector grades) - option (lowercase Sorts students and grades by the students last name SortByGrade vector students, vector grades) option Sorts students and grades by the students grade You will nino need to add code which calls the functions if the user selecta to sort using that sort by function You can find it in the code by searching for provide toplementation for other menu options/ Unlike ont assignments which test matching output this antigament tests output along with testing your functions directly uning unit tests. The unit tests will use your functions with hardcoded vectors, if the testo file the unit tests will print out what it expected compared to what your function did when sorting. If you have any question please reach out via email, discussion board, or during office hours 1 #include 4 #include Igrades): 13 vold AddStudent vector 7/Print thank you message cout else if(selection - MENU PrintMeno: > else if(selection - SORT BY FIRST.NAME SortilyfirstName(students grades): 1 else if(selection - SORT BY LAST NAME Sortbylostone(students, grodes)! 1 else if(selection - SORT BY GRADE) SortilyGrode students grades) ) 1 else cout > numor Students; 96) 97 98 void PrintMenu 99 string menu "Please choose one of the following options: " 100 "ar add a student 10: "r: remove a student " 102 "p: print the class summary " I 103 "a print menu " 100 sort - First none 105 "L: sort - last namen 106 "G: sort - grade 107 *4 quit progra": 188 109 cout > selection: 116 return selection 117) 118 void PrintSummary(const vector> firstNone last None > grade: students.push_back(firstName+ last None): 148 grades push backCarade): 149) 150 void RemoveStudent (vector> firstName> lastName>> grade students.push back(firstName" lastName); 148 grades.push_backgrode): 149) 150 void RemoveStudent (vector &grades) { 151 string removeStudent - Please enter students first and last none": 152 string firstName, lastName; 153 154 cout > firstNome >> Last Name 156 string fullName - firstName + lastNone; 157 for(int i = 0; i 184 ) 185 cout 183 3 184 185 cout Estudents, vector double agrades) { 188 cout string Inane temp. students [k].substr(students. Find first of C")1) if (none temp 210 if(grodes[K] grades[0]) 211 min. indki 212 ) 213 } 214 swap(students. Students[min_ind]); 215 swap Cgrades. grades[min ind]): 216 2 217) 218 196 197 199 Whenna nimwom the shit --- Only show falling tests (5 tests hidden) Download this submission 0/10 4: Test SortByFirstName Checking Students A Your output Sorting by first name Test feedback Expected: Found: Alyssa Massion Alyssa Massion Gussie McFadden Nala Mahon Nala Mahon Gussie McFadden Ricardo Romero Ricardo Romero Stephanie McFadden Stephanie McFadden 0/10 5. Test SortByFirstName - Checking Students and Grades a Your output Sorting by first name Expected studenta: Grades: Found Students: Grades: Alyssa Massion 83.5 Alyssa Massion 83.5 Gussie McFadden 98.7 Nala Mahon 100 Nala Mahon 100 Gussie McFaddon 98.7 Ricardo Romero 89.5 Ricardo Romero 89.5 Stephanie McFadden 100 Stephanie McFadden 100 Test feedback 6: Test SortByLastName - Checking Students 0/10 Your output Sorting by last name Test feedback Expected: Nala Mahon Alyssa Massion Gussie McFadden Stephanie McFadden Ricardo Romero Found: Stephanie McFadden Alyssa Massion Nala Mahon Gussie McFadden Ricardo Romero 7. Test SortByLastName - Checking Students and Grades a 0/10 Your output Sorting by last name Test feedback Expected Students: Grades: Found Students: Grades: Nala Mahon 100 Stephanie McFadden 89.5 Alyssa Massion 83.5 Alyssa Massion 98.7 Gussie MoFadden 98.7 Nala Mahon 100 Stephanie McFadden 100 Gussie McFadden 83.5 Ricardo Romero 89.5 Ricardo Romero 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!