#include <iostream>
#include <fstream>
#include <conio.h>
using namespace std;
class AbClass {
	public :	
		unsigned long int Eshterak, Masraf;
};
class ProcessClass {
	private :
		double Sum;
	public :	
		ProcessClass()
		{
			Sum = 0;
		}
		double GetSum()
		{
			return Sum;
		}
		void AddSum(unsigned long int s)
		{
			Sum += s;
		}
};
int main()
{
	AbClass AbRec;
	ProcessClass Proc;
	int i;
	ifstream myfile("d:\\107_Sample_File.dat", ios::in);
	for (i=1; i <= 15; i++)
	{
		myfile.read((char *)&AbRec, sizeof(AbRec));
		Proc.AddSum(AbRec.Masraf);
	}
	myfile.close();
	cout << "Jame Masraf = " << Proc.GetSum() << endl;
	getch();
}

