Question
#include #include #include FileHandler.h //Do not remove this line using namespace std; int main() { int numStudents; //this is the number of enrolled students //This
#include
using namespace std;
int main() { int numStudents; //this is the number of enrolled students //This function determines the number of students being processed int result = FileHandler1(numStudents); if (result != 0) { return 1; //ERROR if file not properly opened } //These are arrays that hold all information for each enrolled student //Call these arrays in your code to access their information //Each index has the information for a specific student: //Example: Index 0 has the information for --> Dennis Wakeman Kingston 3.24 //Example: Index 37 has the information for --> Jenna Zheng Poughquag 3.35 string studentFirstName[numStudents]; string studentLastName[numStudents]; string studentHomeTown[numStudents]; float studentGPA[numStudents]; //This function fills in the 4 student arrays int result2 = FileHandler2(studentFirstName, studentLastName, studentHomeTown, studentGPA); if (result2 != 0) { return 1; //ERROR if second file not properly opened } cout College Statistics" Dean\'s List" = 3.65) // Print using the following format: // // LastName, FirstName - HomeTown (newline) // // // //
return 0; }
The existing code fills in the information for the following variables: numStudents an int with the value of how many enrolled students there are studentFirstName a string array holding the first name of each enrolled student studentLastName a string array holding the last name of each enrolled student studentHomeTown a string array holding the home town of each enrolled student studentGPA a float array holding the GPAs of each enrolled student Such that each index holds the information of a particular student. For example: The 17th student, Carina Salvino of Marbletown, has a 2.60 GPA. Her information is found inside of the arrays like this: As long as the index is the same in each array (as with "16" the above example), then you will have access to all of that student's information. You must write code to do the following: 1.) Identify the average GPA across all students enrolled 2.) Identify how many unique home towns there are a.) Example: If 3 students are from New Paltz, 12 are from Poughkeepsie, and 1 is from Kingston, then that is a total of 3 unique home towns 3.) Using loops - follow the Bubble Sort Algorithm to sort all of the arrays alphabetically based solely upon the student's last names 4.) Lastly, print out all of the students (alphabetically sorted by last name) who made the Dean's List (GPA >= 3.65) in the following manner: LastName, FirstName - HomeTown Example: Salvino, Carina - Marbletown
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started