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...


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


#include


#include


#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


cout




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()


{




}






CISC1600 C++ Programming Assignment 4 Due June 24 (hard deadline) 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 #include #include #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 < "your="" options="" for="" sorting="" (key="" in="" 'g'="" to="" sort="" students'="" data="" in="" terms="" of="" gpa="" in"="">< endl="">< "both="" ascending="" and="" decending="" order;="" key="" in="" 'a'="" to="" sort="" students'="" data="" in="" terms="" of"="">< endl="">< "alphabetical="" order="" of="" students'="" last="" name;="" key="" in="" 'b'="" for="" both="" types="" of="" sorting):="" ";="" cin="">> option; if (option == 'g') { } else if (option == 'a') { } else if (option == 'B') { } else cout < "incorrect="" option!"="">< endl; 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() { } endl;="" 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()="" {="">
Jun 24, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here