Write a C++ program that defines class Student with data members:
ID, Name, average and array of 5 integer grades.
And member Functions:
- A private function computeAverage: to compute student’s average( the data member).
- A public function getAverage that returns the value of student’s average
- Overload the following operators (either as member function or a friend function)
1. The extraction operator << to read student’s ID, Name and grades
2. The insertion operator >> to display all student’s data (ID, Name, grades and the average)
3. The operator < to compare two student objects in terms of the average
( as member function) for example (the call for this operator):
If (s1<s2) // s1 and s2 are student objects
Cout<<”average of “ <<s1.getName()<<”is less than “ <<se.getName();
- The operator + to add an integer value to the students average
S1+5; // add 5 to the average of object s1
- The operator + : to add an integer value to the students average in the form: 5+S1; // add 5 to the average of object s1