void ShowData(); void Marks(); //Function to change Score long R_id() {return Aid;} }; void Update(int PId) { fstream fin; fin.open(“AllData.DAT”,ios::binary|ios::in|ios::out); Player pn; int Record=0,Found=0; while (!Found&&File.read((char*)&pn, sizeof(pn))) { if (Id==A.R_id()) { cout<<”Enter Marks…”; cin>>A.Marks(); _________________ //statement 1 _________________ //statement 2 Found = 1; } Record++; } if(Found==1) cout<<”Record Modified”; fin.close(); } Write the Statement1 to position the File Pointer at the beginning of the Record for which the Id matches with the argument passed, and Statement2 to Player’s write the updated Record at that position. Write a function in C++ to read the content of a and display b) 2 text file “Story.txt” all those lines which are either starting with starting with ‘A’ or ‘X’. A binary file containing records of the following class CANDY type c) 3 “Items.dat”, : class CANDY { char c_no[10]; char c_name[40]; long no_of_items; public: void getdata()
void ShowData(); void Marks(); //Function to change Score long R_id() {return Aid;} }; void Update(int PId) { fstream fin; fin.open(“AllData.DAT”,ios::binary|ios::in|ios::out); Player pn; int Record=0,Found=0; while (!Found&&File.read((char*)&pn, sizeof(pn))) { if (Id==A.R_id()) { cout<<”Enter Marks…”; cin>>A.Marks(); _________________ //statement 1 _________________ //statement 2 Found = 1; } Record++; } if(Found==1) cout<<”Record Modified”; fin.close(); } Write the Statement1 to position the File Pointer at the beginning of the Record for which the Player’s Id matches with the argument passed, and Statement2 to write the updated Record at that position. b) Write a function in C++ to read the content of a text file “Story.txt” and display all those lines which are either starting with ‘A’ or starting with ‘X’. 2 c) A binary file “Items.dat”, containing records of the following class CANDY type : 3 class CANDY { char c_no[10]; char c_name[40]; long no_of_items; public: void getdata()
489411995question_paper_computer_scence_xii.docx