12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Important Questions And Answers Study Material - QB365 Set B
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set D
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set C
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set B
NEW12th Standard CBSE
CBSE 12th Biology Sexual Reproduction in Flowering Plants Assertion and Reason Study Material - QB365 Set A

Published on: 30/07/2018
Some of the important questions from the chapter Data File Handling in C++ covered in this question paper. The questions are prepared from the book back and PTA question.
Teachers can examine their student’s knowledge. They can prepare plenty of question paper with answer key. For subscription, please Click Here.
Download CBSE Class 12th Standard CBSE Computer Science question papers, sample papers, important questions, and previous year solved papers in PDF format. Get free study materials, NCERT solutions, and exam preparation resources for Class 12th Standard CBSE Computer Science
Questions + Answers key
Take MCQ Computer Science Test

1.
Write a function COUT_TO() in C++ to cout the presence of aworld 'to' in text file NOTES.TXT is as it is very important to know that smoking is injurious to health,let us take initiative to stop it.The function COUT_TO()will display the following message cout of-to=in file:3
2.
Write a function EUCout() in C++,which should reads each character of a a text file.IMP.TXT,should count and display the occurrence of
alphabets E and U (including small case e and u too). e.g. if the file contain is as follows: Update information is simplified by official websites.The EUCount() function should display the output as:
E:4
U:1
3.
Write the function in C++ to read the content of a text file PLACES.TXT and display all those lines on screen,which are either starting with'P' or starting with'S'
4.
Assuming the class GAMES as declard below, write a function in C++ to read the objects of GAMES from binary file GAMES.DAT and
display those details of those GAMES, which are meant for children of Age Range"8 to 13"
class GAMES
{
int Gamecode;
char GameName[10];
char *AgeRange;
public:
void Enter()
{
cin>>GameCode;
gets(GameName);
gets(AgeRange);
}
void Display()
{
cout<
char *AgeR() {return AgeRange;}
};
5.
Write a function in C++ to search for the details(phone no and Calls) of those phons, which have more than 1000 calls from a binary file phons.dat. Assuming that this binary file contains records? objects of class phone, which is defined below.
class phone
{
char phoneno[10];
int calls;
public:
void get(){gets(phoneno);
cin>>calls;
void billing(){cout<
};
6.
Write a function in C++ to count the number of "ME" or "MY" words prsent in a text file DIARY.TXT.If the file DIARY.TXT content is as follows: My first book was Me and MY Family. It gave me chance to be known to the world. The count of the function should be Count of Me/My in file:4
7.
Write a function in C++ to search()for a laptop from a binary file LAPTOP.DAt containing the objects of class LAPTOP (as defined below).The user should enter the ModelNo and the function should search and display the details of the LAPTOP.
class LAPTOP
{
long ModelNo;
float RAM,HOD;
char Details[120];
public:
void StockEnter()
{
cin>>ModelNo>>RAM;
cin>>HOD;gets(Details);
}
void StockDisplay()
{
cout<
long ReturnModelNo()
{
return modelNo;
}
};
8.
Write a function in C++ to count the words "to" and "the" present in a text file POEM.TXT.(Note that the words "to" and "the" are complete words.)
9.
Write a function in C++ to count number of uppercase alphabets prsent in a text file ARTICLE.TXT.
10.
Write a function to count the member of words prsent in a text file named PAPER.TXT.Assume that each word is separated by a single blank/space in the beginning and end of the file.
1.
void COUNT_TO()
{
ifstream fin("NOTES.TXT");
Char str[10];
int C=0;
while(!fin.eof())
{
fin>>str;str[0]=tolower(str[0]);
if(strcmp(str,"0")==0)
C++;
}
fin.close();
cout<<"Cout of-to-in file:"<
}
2.
void EUCount()
{
ifstream infile("IMP.TXT");
char ch;
int count E=0,coutU=0;
while(infile)
{
infile.get(ch);
if(ch=='E' ch=='e')
countE++;
else if(ch=='U' ch=='u')
countU++;
}
cout<<"E:"<
3.
void Display()
{
ifstream fcin("PLACES.TXT);
char ch[100];
fcin.getline(ch,100);
while(fcin)
{
if(Ch[0]=='P' ch[0]=="S")
{
cout<
}
fcin.close();
}
4.
void READGAMES()
{
GAMES obj;
ifstream infile(:GAMES.DAT:);
while(infile.read((char*)&obj,sizeof(obj)))
{
if(strcmp(obj.Agr(),"8 to 13")==0)
obj.Display();
}
infile.close();
}
5.
void show()
{
ifstream fcin("phones.dat",ios::in ios::binary);
phone P;
while(fcin.read((char*)&p,sizeof(p)))
{
if(P.getCalls()>1000)
{
P.billing();
}
}
fcin.close();
}
6.
void count()
{
ifsrream fin("DIARY.TXT");
char word[10];
int C=0;
while(!fin.eof())
{
fin>>word;
word[0]=toupper(word[0]);
if ((strcmp(word,"Me")==0 (strcmp(word,"My")==0))
C++
}
cout<<"Count of Me/My in file:"<
}
7.
void search()
{
LAPTOP L;long ModelNo;
ifstream fin;
cout<<"enter the model no of laptop";
cin>>ModelNo;
fin.open("LAPTOP.DAT".ios::binary);
while(fin.read((char*)&L,sizeof(L)))
{
if(L.REturnModelNo()==ModelNo)
L.StockDisplay();
}
fin.close();
}
8.
void Wordcount()
{
ifstream fin("POEM.TXT");
char word[80];
int WC=0;
while(!fin.eof())
{
fin>>word;
if((strcmp(word,"to")==0) (strcmp(word,"the")==0))
WC++;
}
cout<
};
9.
int countupcase()
{
ifstream fin("ARTICLE.TXT");
char ch;
int count = 0;
while(!fin.eof())
{
fin>>ch;
if(isupper(ch))
count++;
}
fin.close();
return count;
}
10.
void countwords()
{
ifsream fin("PAPER.TXT",ios ::in);
char wd[80];
int count=0;
while(!fin.eof())
{
fin>>wd;
if(fin.eof())break;
count++;
}
fin.close();
count<<count;
}
12th Standard CBSE Syllabus & Materials
12th Standard CBSE
CBSE 12th Standard Biology Sexual Reproduction in Flowering Plants Sample Question Papers Study Material - QB365 Set 1
NEW12th Standard CBSE
CBSE 12th Chemistry d- and f- Block Elements Important Questions And Answers Study Material - QB365 Set B
NEW12th Standard CBSE
CBSE 12th Chemistry d- and f- Block Elements Important Questions And Answers Study Material - QB365 Set A
NEW12th Standard CBSE
CBSE 12th Chemistry Chemical Kinetics Important Questions And Answers Study Material - QB365 Set B
CBSE 12th Standard CBSE Subjects
CBSE Standards