please just help with parts afterr // 3) Write friend function for the following class to overload the << and >> operators. The friend function, input operator (operator >>), should read 5 elements into the array attribute called “grade” for the objet and output (operator <<) should print the content of the array “grade” of the object on the screen. class Math { // put the prototype of the friend functions here public: intgrade[5]: math( ) {for (int i=0, i<10, i++) grade[i] = 0;}; // implement the overloaded input operator function // implement the overloaded output operator function void main () { Math ObjA; //your friend function should be able to take care of the following code cin >> ObjA; cout << ObjA;
please just help with parts afterr //
3) Write friend function for the following class to overload the << and >> operators. The friend function, input operator (operator >>), should read 5 elements into the array attribute called “grade” for the objet and output (operator <<) should print the content of the array “grade” of the object on the screen.
class Math
{ // put the prototype of the friend functions here
public:
intgrade[5]:
math( ) {for (int i=0, i<10, i++) grade[i] = 0;};
// implement the overloaded input operator function
// implement the overloaded output operator function
void main ()
{
Math ObjA;
//your friend function should be able to take care of the following code
cin >> ObjA;
cout << ObjA;
Step by step
Solved in 4 steps with 1 images