We were given our original project back and asked to overload all the operators, even if we did use them we had to overload them. The teacher said we would have to rewrite some of our code to make the overloading work. I am clueless as to even how to begin to implement overloading.

Here is my original code: It reads in a file that holds the scores of students, then outputs the data into another file with each student's average appended to the end and the overall average for each test(quiz1 quiz2 etc....) underneath their respective column.

Code:
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;

class Grades
{
public:
	Grades();
	Grades(int quiz1, int quiz2, int midterm, int final);
	void Input(ifstream& Fin);
	void Output(ofstream& Fout);
	int GetQuiz1();
	int GetQuiz2();
	int GetMidterm();
	int GetFinal();
	void SetQuiz1(int NewQuiz1);
	void SetQuiz2(int NewQuiz2);
	void SetMidterm(int NewMidterm);
	void SetFinal(int NewFinal);

private:
	int mQuiz1;
	int mQuiz2;
	int mMidterm;
	int mFinal;
};

int main()
{
	Grades Student;
	Grades Sum; //will be used to get average of all quizes
	double Avg;
	double Quiz1TotalAverage;
	double Quiz2TotalAverage;
	double FinalTotalAverage;
	double MidtermTotalAverage;

    ifstream Fin;
	ofstream Fout;

	Fin.open("input.txt");
		if(Fin.fail())
		{
			cout << "Input file opening failed.\n";
			exit(1);
		}

	Fout.open("output.txt");
		if(Fout.fail())
		{
			cout << "Output file opening failed.\n";
			exit(1);
		}
	
     Fout << " Quiz1 " << " Quiz2 " << " Midterm " << "      Final " << " Average " << endl;

          

	while(!(Fin.eof()))
	{
		Student.Input(Fin);
		Student.Output(Fout);
		Avg = 20.0 * (Student.GetQuiz1() + Student.GetQuiz2())/20 + (20.0 * Student.GetMidterm())/100 + (60.0 * Student.GetFinal())/100;
		//calculates the averages for the whole class for quiz1, quiz2, midterm and final exams. 
		Sum.SetQuiz1(Sum.GetQuiz1() + Student.GetQuiz1()); 
		Sum.SetQuiz2(Sum.GetQuiz2() + Student.GetQuiz2());
		Sum.SetFinal(Sum.GetFinal() + Student.GetFinal());
		Sum.SetMidterm(Sum.GetMidterm() + Student.GetMidterm());
		Fout << setw(10) << Avg << endl;
	}
    //the total average for each quiz, midterm and final is set equal to a variable
	//whose value will be output to the output file
	Quiz1TotalAverage = Sum.GetQuiz1()/15;
	Quiz2TotalAverage = Sum.GetQuiz2()/15;
	FinalTotalAverage = Sum.GetFinal()/15;
	MidtermTotalAverage = Sum.GetMidterm()/15;

	Fout << "___" << setw(10) << "___" << setw(10) << "___" << setw(10) << "___" << endl;
	Fout << Quiz1TotalAverage << setw(10) << Quiz2TotalAverage << setw(10) << FinalTotalAverage << setw(10) <<MidtermTotalAverage;

	Fin.close();
	Fout.close();

	return 0;

}

Grades::Grades() : mQuiz1(0), mQuiz2(0), mMidterm(0), mFinal(0)
{
}

Grades::Grades(int mQuiz1, int mQuiz2, int mMidterm, int mFinal)
{
}

void Grades::Input(ifstream& Fin)
{
	Fin >> mQuiz1 >> mQuiz2 >> mMidterm >> mFinal;
}

void Grades::Output(ofstream& Fout)
{
    Fout << mQuiz1 << setw(10)<< mQuiz2 << setw(10)<< mMidterm << setw(10)<< mFinal;
}

int Grades::GetQuiz1()
{
	return mQuiz1;
}
int Grades::GetQuiz2()
{
	return mQuiz2;
}

int Grades::GetMidterm()
{
	return mMidterm;
}

int Grades::GetFinal()
{
	return mFinal;
}

void Grades::SetQuiz1(int NewQuiz1)
{
	mQuiz1 = NewQuiz1;
}

void Grades::SetQuiz2(int NewQuiz2)
{
	mQuiz2 = NewQuiz2;
}

void Grades::SetMidterm(int NewMidterm)
{
	mMidterm = NewMidterm;
}

void Grades::SetFinal(int NewFinal)
{
	mFinal = NewFinal;
}


Here are some of my attempts in implementing overloading:


Code:
class Grades
{
public:
	Grades();
	Grades(int quiz1, int quiz2, int midterm, int final);
	friend Grades operator +(const Grade& Test1, const Grade& Test2);
	void Input(ifstream& Fin);
	void Output(ofstream& Fout);
	int GetQuiz1();
	int GetQuiz2();
	int GetMidterm();
	int GetFinal();
	void SetQuiz1(int NewQuiz1);
	void SetQuiz2(int NewQuiz2);
	void SetMidterm(int NewMidterm);
	void SetFinal(int NewFinal);

private:
	int mQuiz1;
	int mQuiz2;
	int mMidterm;
	int mFinal;
};

int main()
{
	
	Grades Sum; //will be used to get average of all quizes
	Grades Student;
	Grades Study(GetQuiz1(), GetQuiz2(), GetMidterm(), GetFinal())
	Grades total
Code:
Grades operator +(const Grades& Test1, const Grades& Test2)
{
	Grades temp;

	temp = Test1.mQuiz1 + Test1.mQuiz2;

	return temp;
}


As stated before, I don't know what direction to go in and i have to overload
the + - * / == << and >> operators.

So where do i start? What needs to be replaced and what just needs to be augmented. Thank you in advance