#include <iostream>
#include <string>
#include <vector>
struct StudentInfo{
std::string _mFullname;
std::string _mBirthday;
std::string _mClass;
double _mGrade[8];
double _mAverage;
StudentInfo(std::string f, std::string b, std::string c)
:_mFullname(f), _mBirthday(b), _mClass(c)
{
_mAverage = 0.0;
for(int x = 0; x < 8; ++x){
_mGrade[x] = 0.0;
}
}
};
void CalculateAverage(StudentInfo* _sStut){
for(int x = 0; x < 8; ++x){
_sStut->_mAverage += _sStut->_mGrade[x];
}
_sStut->_mAverage /= 8;
}
void SortGradebyStudent(std::vector<StudentInfo>& _mRecord, int students){
for(int x = 0; x < students; ++x){
for(int y = 1; y < students - 1; ++y)
if(_mRecord[y]._mAverage < _mRecord[y - 1]._mAverage)
std::swap(_mRecord[y], _mRecord[x - 1]);
}
}
int main(){
StudentInfo S("W", "12/1933", "4A");
StudentInfo R("W", "11/1937", "5A");
StudentInfo T("W", "18/1933", "6C");
StudentInfo W("W", "17/1933", "7D");
std::vector<StudentInfo> rec;
rec.push_back(S);
rec.push_back(R);
rec.push_back(T);
rec.push_back(W);
}