4. static vector<Student> removeByID(vector<Student>::iterator begin, vector<Student>::iterator
end, long ID);
static vector<Student> updateStudent(vector<Student>::iterator begin, vector<Student>::iterator
end, const Student &s);
static vector<Student> findStudents(vector<Student>::iterator begin, vector<Student>::iterator
end, float gpa);
static vector<Student> honorIdentifier(vector<Student>::iterator v1_begin,
vector<Student>::iterator v1_end, vector<Student>::iterator v2_begin, vector<Student>::iterator
v2_end);
};
/*
* EXERCISE: #1A
*
* Returns the highest GPA value possessed by any Student in the given list
* starting at the begin iterator up to and not including the end iterator.
*
*/
double Student::maxStudentGPA(vector<Student>::iterator begin, vector<Student>::iterator end)
{
//YOUR CODE HERE
}
/*
* EXERCISE: #1B
*
* Returns the lowest GPA value possessed by any Student in the given list.
5. * starting at the begin iterator up to and not including the end iterator.
*
*/
double Student::minStudentGPA(vector<Student>::iterator begin, vector<Student>::iterator end)
{
//YOUR CODE HERE
}
/*
* Exercise #1C
*
* For the first N students, calculate the average GPA
* starting at the begin iterator up to and not including the end iterator.
*
* Formula: average = sum / N
* Assume N is greater than 0
*/
double Student::averageGPA(vector<Student>::iterator begin, vector<Student>::iterator end, int
N){
//YOUR CODE HERE
}
/**
*
* EXERCISE #2
*
6. * Given a course code, you must return a vector that contains
* only the unique ID of the Students that have that particular course code
* starting at the begin iterator up to and not including the end iterator.
*
*/
vector<long> Student::countStudents(vector<Student>::iterator begin, vector<Student>::iterator
end, string code){
vector<long> result;
//YOUR CODE HERE
return result;
}
/*
* EXERCISE #3
*
* Return a vector that contains all the Students that have a GPA greater
* or equal to the GPA passed as the parameter
* starting at the begin iterator up to and not including the end iterator.
*
* Assume the list contains at least one such element
*/
vector<Student> Student::findStudents(vector<Student>::iterator begin,
vector<Student>::iterator end, float gpa){
vector<Student> result;
//YOU CODE HERE
7. return result;
}
/*
* EXERCISE: #4
*
* Return a new vector that has the same elements as the original vector
* starting at the begin iterator up to and not including the end iterator.
* but with the Student of the given ID removed.
*
*/
vector<Student> Student::removeByID(vector<Student>::iterator begin,
vector<Student>::iterator end, long ID){
vector<Student> result;
//YOUR CODE HERE
return result;
}
/*
* EXERCISE #5
*
* Return a new vector that has the same elements as the original vector
* starting at the begin iterator up to and not including the end iterator,
* but with the given Student's data updated. If the Student is not present,
* add it to the list.
*
8. * Remember that each Student has an unique identifier
*/
vector<Student> Student::updateStudent(vector<Student>::iterator begin,
vector<Student>::iterator end, const Student &s){
vector<Student> result;
// YOUR CODE HERE
}
/*
* BONUS EXERCISE
*
* Find the Students in both vectors that qualify to be a part of the honor roll
* starting at the begin iterator up to and not including the end iterator.
* Students may only qualify to be part of the honor roll if they have a GPA of 3.5 or higher.
*
* You may only make use of a single loop, but you may assume that both vectors have equal
length.
*
*/
vector<Student> Student::honorIdentifier(vector<Student>::iterator v1_begin,
vector<Student>::iterator v1_end, vector<Student>::iterator v2_begin, vector<Student>::iterator
v2_end){
vector<Student> result;
// YOUR CODE HERE
return result;
}