#include
using namespace std;
class Student {
private:
int id;
float score;
public:
Student() {
id = 0;
score = 0;
}
Student(int id, float score) {
this->id = id;
this->score = score;
}
float getScore() {return score; }
int getID() {return id; }
};
void max(Student* s, int size) {
if (s == NULL || size < 1) return;
int l = 0;
for (int i = 1; i < size; i++) {
if (s[i].getScore() > s[l].getScore())
l = i;
}
cout << "Student with ID \"" << s[l].getID()
<< "\" has the largest grade." << endl;
}
int main() {
const int num = 5;
Student students[num] = {
Student(1, 78), Student(2, 92), Student(4, 81),
Student(4, 89), Student(5, 68)
};
max(students, 1);
return 0;
}