Using C++ Write the following code Create a struct data type called Student that
ID: 3678397 • Letter: U
Question
Using C++
Write the following code Create a struct data type called Student that contains: name a string that may contain blank spaces id an integer percent a double, current percent of course points grade a char representing a letter grade Main program: Declare an array of 20 Student records Ask the user for the name of an input file and open that file for input Read the Student information from the file into the array (the names, ids, and percents) Calculate the grade field for each Student in the array (based on a 90/80/70/60/less scale for A/B/C/D/F grades.) Sort the array of Students into decreasing order, comparing percent values. output all of the information for all of the Students (line the fields up in columns to make it easily readable) Sort the array of Students into increasing order, comparing names output all of the information for all of the Students (line the fields up in columns to make it easily readable) Use functions to do all of the major tasks in the program (open file, input, calculate, sort, output) Include the normal commentsExplanation / Answer
#include // for inpit and output #include // for string nama... using namespace std; // for name space.. struct student // declare struct { string name,no_matric; string sub_code[10],sub_name[10],sub_grade[10]; float credit_hour[10]; }student1; main() { int credit_hours[10]; int sem,total_subject; //'b', 'a',total_credit_hours and total_point //are removed float value[10],gpa[10],get_point[10]; float cgpa; float total_point_sem = 0; //Initialise value int total_credit_hours_sem = 0; //Initialise value cin.ignore(); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.