Question: undefined 1 #include #include 2 3 5 6 4 class Student { public: int mid; double mGPA; std::string mAddress; std::string mBiography; 10 }; 7 8

undefined 1 #include #include 2 3 5 6 4 class Student {public: int mid; double mGPA; std::string mAddress; std::string mBiography; 10 }; 78 9 11 13 12 int main(int argc, char *argv []) {undefined

1 #include #include 2 3 5 6 4 class Student { public: int mid; double mGPA; std::string mAddress; std::string mBiography; 10 }; 7 8 9 11 13 12 int main(int argc, char *argv []) { Student *students = new Student [100]; Student ** studentsPtr = new Student*[100]; 14 15 16 17 srand (100); // Seed random number generator for (int i = 0; i mGPA > studentsPtr[j]->mGPA) { Student *temp studentsPtr[j]; studentsPtr[j] studentsPtr[j-1]; studentsPtr[j-1] temp; } 31 32 = 33 34 35 } 36 } 37 38 39 for (int i = 0; i mGPA); } 40 41 42 return 0; 43 } (a) What is the value of students? (b) What is the value of studentsPtr? (c) Which of the above is being sorted? (d) Why was the above (in c) chosen over the other? What advantage do you see? (e) Write the commands to free memory. 1 #include #include 2 3 5 6 4 class Student { public: int mid; double mGPA; std::string mAddress; std::string mBiography; 10 }; 7 8 9 11 13 12 int main(int argc, char *argv []) { Student *students = new Student [100]; Student ** studentsPtr = new Student*[100]; 14 15 16 17 srand (100); // Seed random number generator for (int i = 0; i mGPA > studentsPtr[j]->mGPA) { Student *temp studentsPtr[j]; studentsPtr[j] studentsPtr[j-1]; studentsPtr[j-1] temp; } 31 32 = 33 34 35 } 36 } 37 38 39 for (int i = 0; i mGPA); } 40 41 42 return 0; 43 } (a) What is the value of students? (b) What is the value of studentsPtr? (c) Which of the above is being sorted? (d) Why was the above (in c) chosen over the other? What advantage do you see? (e) Write the commands to free memory

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!