Write a definition for function BUMPER( ) in C++ to read each object of a binary file GIFTS.DAT, find and display details of those gifts, which has remarks as “ÖN DISCOUNT”. Assume that the file GIFTS.DAT is created with the help of objects of class GIFTS, which is defined below:
class GIFTS
{
int ID;char Gift[20],Remarks[20]; float Price;
public:
void Takeonstock()
{
cin>>ID;gets(Gift);gets(Remarks);cin>>Price;
}
void See()
{
cout<<ID<<':'<<Gift<<':'<<Price<<':'<<Remarks<<endl;
}
char *GetRemarks(){return Remarks;}
}
void BUMPER()
{
GIFTS G;
ifstream fin;
fin.open(“GIFTS.DAT”, ios::binary);
while(fin.read((char*)&G, sizeof(G)))
{
if(strcmp(G.GetRemarks(), 'ON DISCOUNT')==0)
G.See();
}
fin.close();
}