Question
**8 #include #include #include using namespace std; int searchlinear(int arr[],int id, int size) { int i; for (i= 0; i } int main() { const
**8
#include } int main() { const int NUM_ELMTS=18; /etid, MAJOR and GPS are parallel arrays int netID[NUM_ELMTS]; string major[NUM_ELMTS]; double GPA[NUM_ELMTS]; //sorted GPA double sortedGPAbyGPA[NUM_ELMTS]; int sortedNetIDbyGPA[NUM_ELMTS]; string sortedMajorbyGPA[NUM_ELMTS]; //sorted NetID int sortedNetIDbyID[NUM_ELMTS]; string sortedMajorbyID[NUM_ELMTS]; double sortedGPAbyID[NUM_ELMTS]; int i=0,j,k; int min,max; int index; int ID; int swapID; string swapmajor; double swapGPA; string line; string f_name; int choice,n; cout>f_name; ifstream stufile(f_name.c_str()); if (stufile.is_open()) { while (stufile>>line) { netID[i]=stoi(line); stufile>>line; major[i]=line; stufile>>line; GPA[i]= stod(line); i++; } stufile.close(); for(j=0;j sortedGPAbyGPA[max]) max=k; swapGPA=sortedGPAbyGPA[max]; sortedGPAbyGPA[max]=sortedGPAbyGPA[j]; sortedGPAbyGPA[j]=swapGPA; swapmajor=sortedMajorbyGPA[max]; sortedMajorbyGPA[max]=sortedMajorbyGPA[j]; sortedMajorbyGPA[j]=swapmajor; swapID=sortedNetIDbyGPA[max]; sortedNetIDbyGPA[max]=sortedNetIDbyGPA[j]; sortedNetIDbyGPA[j]=swapID; } // sorting by swapID for (j = 0; j >choice; if(choice==1) { cout>n; for(j=0;j } }while(choice!=3); } else cout ***this is my code. I need help to make my outputs look like my expected outputs shown in the pictures otherwise I will keep getting errors.
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