Observe the program segment given below carefully, and answer the question that follows:
class PracFile
{ int Pracno;
char PracName[20];
char TimeTaken;
int Marks; public:
//function to enter PracFile details
void EnterPrac();
//function to display PracFile details
void ShowPrac();
//function to return TimeTaken
char RTime() { return TimeTaken; }
//fuction to assign Marks
void Assignmarks(int M)
{ Marks=M; };
};
void AllocateMarks()
{ fstream File;
File.open("MARKS.DAT",ios::in|ios::out);
PracFile P;
int Record=0;
while(File.read((char*)&P,sizeof(P)))
{ if(P.RTime()>50)
P.Assignmarks(0);
else P.Assignmarks(10);
_____________ //statement 1
_____________ //statement 2
Record++;
}
File.close();
}
If the function AllocateMarks() is supposed to Allocate Marks for the records in file MARKS.DAT based on their value of member TimeTaken.
Write C++ statements for the statement 1 and statement 2, where statement 1 is required to position the file write pointer to an appropriate place in the file statement 2 is to perform the write operation with the modified record.