Question: struct StudentInfo { string name; int grade; //need to overload the > operator here } Use the following StudentInfo structure type to store student record:
| struct StudentInfo { string name; int grade; //need to overload the > operator here } |
Use the following StudentInfo structure type to store student record: name and grade.
In a function named populateStudentRecord(), use a list data structure to populate the student data. Make up the data by yourself using some constant name and grade values in the function (do not ask the user to provide data).
In the main() function:
Create a list of objects of StudentInfo type.
Call the populateStudentRecord() to populate the list object.
Use the built-in sort algorithm from STL to sort the list by name and display the information in this format "name - grade". Remember, you need to overload the < operator for the structure so that the StudentInfo structure type variables can be compared.
Calculate the maximum and minimum grades and the class average and display them.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
