#include #include #include using namespace std; // ----------------------------- // Prototype of the class student // ----------------------------- class student{ // methods public: //student(); // default constructor student(string name = "", float mark = 0); ~student(); void Print() const; //friend ostream& operator<<(ostream& os, const student& s); // data members // Accessors string GetName() const {return name;} float GetMark() const {return mark;} int GetRank() const {return rank;} // Mutators void SetName(string n){name = n;} void SetMark(float m){mark = m;} void SetRank(int r){rank = r;} void Print(); private: string name; float mark; int rank; }; // ----------------------------- // Implementation of the class student // ----------------------------- // put default values to all the data members /* student::student(){ name = ""; mark = 0; rank = -1; } */ //other constructor with 2 arguments student::student(string n, float m){ name = n; mark = m; rank = -2; } student::~student(){ } void student::Print(){ cout<<"This student is "<& vec){ string Best(const vector& vec){ student ImTheBest; float max_mark = 0; if(vec.size() == 0){ cerr<<"There is no students !"<= max_mark){ ImTheBest = vec[i]; max_mark = vec[i].GetMark(); } } return ImTheBest.GetName(); } void Print2(student s){ cout<<"This student is "< v; v.push_back(s1); v.push_back(s2); v.push_back(s3); //student best_ = Best(v); //cout<