int Count = Bytes / sizeof(Item); File.close(); return Count; } (b) Write a function in C++ to count the number of alphabets present in a text file “NOTES.TXT”. 2 (b) Write a function in C++ to add new objects at the bottom of a binary file “STUDENT.DAT”, assuming the binary file is containing the objects of the following class. 3 class STUD { int Rno; char Name[20]; public: void Enter(){cin>>Rno;gets(Name);} void Display(){cout<<Rno<<Name<<endl;} }; void Addnew() { fstream FIL; FIL.open(“STUDENT.DAT”,ios::binary|ios::app); STUD S; char CH; do { S.Enter(); FIL.write((char*)&S,sizeof(S)); cout<<”More(Y/N)?”;cin>>CH; } while(CH!=’Y’); FIL.close();
int Count = Bytes / sizeof(Item); File.close(); return Count; } (b) Write a function in C++ to count the number of alphabets present in a text file “NOTES.TXT”. 2 (b) Write a function in C++ to add new objects at the bottom of a binary file “STUDENT.DAT”, assuming the binary file is containing the objects of the following class. 3 class STUD { int Rno; char Name[20]; public: void Enter(){cin>>Rno;gets(Name);} void Display(){cout<<Rno<<Name<<endl;} }; void Addnew() { fstream FIL; FIL.open(“STUDENT.DAT”,ios::binary|ios::app); STUD S; char CH; do { S.Enter(); FIL.write((char*)&S,sizeof(S)); cout<<”More(Y/N)?”;cin>>CH; } while(CH!=’Y’); FIL.close();