Assuming a student’s data record consists of the student’s name and the student’s GPA. Write a C++ program that first reads students’ data records from a user (of the program), and it continues to read students’ data records until the user decides to stop keying the data, and the program will then sort the keyed in data records into sorted order in terms of students’ GPAs, or in terms of the alphabetical order of the students’ last names, or doing both, depending on the user’s option. You may use the following framework to develop your program.
#include
using namespace std;
struct student
{
string name;
float gpa;
};
vector v;
void input_data();
void swap(student *std1, student *std2);
void sort_gpa_asc();
void sort_gpa_des();
void sort_name();
void show_data();
int main()
char option;
input_data();
cout
cin >> option;
if (option == 'g')
}
else if (option == 'a')
else if (option == 'B')
else
return 0;
void input_data()
void swap(student *std1, student *std2)
void sort_gpa_asc()
void sort_gpa_des()
void sort_name()
void show_data()
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here