CBSE Class 12 Computer Science HOTs Programming in C++

CBSE Class 12 Computer Science HOTs Questions Database for chapter Programming in C++. Based on CBSE and NCERT guidelines. The students should practice these HOTs Questions to gain perfection which will help him to get more marks in CBSE examination. Based on CBSE and NCERT guidelines. Based on the same pattern as released by CBSE every year. CBSE releases HOTs Questions every year. These papers are released prior to the CBSE board examinations so that students can do practice. database of 1 marks, 2 marks, 3 marks and 5 marks questions.

1 Mark Questions
Programming in C++
1. Observe the program segment carefully and answer the question that follows:
class item
{
int item_no;
char item_name[20];
public:
void enterDetail( );
void showDetail( );
int getItem_no( ){ return item_no;}
};
void modify(item x, int y )
{
fstream File;
File.open( “item.dat”, ios::binary | ios::in | ios::out) ;
item i;
int recordsRead = 0, found = 0;
while(!found && File.read((char*) &i , sizeof (i)))
{
recordsRead++;
if(i . getItem_no( ) = = y )
{
_________________________//Missing statement
File.write((char*) &x , sizeof (x));
found = 1;
}
}
if(! found)
cout<<”Record for modification does not exist” ;
File.close() ;
}
If the function modify( ) is supposed to modify a record in the file “ item.dat “, which item_no is y, with the values of item x passed as argument, write the appropriate statement for the missing statement using seekp( ) or seekg( ), whichever is needed, in the above code that would write the modified record at its proper place.
2 Observe the program segment carefully and answer the question that follows:
class member
{
int member_no;
char member_name[20];
public:
void enterDetail( );
void showDetail( );
int getMember_no( ){ return member_no;}
};
void update(member NEW )
{
fstream File;
File.open( “member.dat”, ios::binary|ios::in|ios::out) ;
member i;
while(File .read((char*) & i , sizeof (i)))
{
if(NEW . getMember_no( ) = = i . getMember_no( ))
{
_________________________//Missing statement
File.write((char*) &NEW , sizeof (NEW));
}
}
File.close() ;
}
If the function update( ) is supposed to modify the member_name field of a record in the file “ member.dat” with the values of member NEW passed as argument, write the appropriate statement for the missing statement using seekp( ) or seekg( ), whichever is needed, in the above code that would write the modified record at its proper place.

Please refer to attached file for CBSE Class 12 Computer Science HOTs Programming in C++

Tags: 

 


Click to View or Download pdf file
Click for more Computer Science Study Material

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

CBSE Boards Answer Sheet Evaluation Class 10 and Class 12

HRD Minister Ramesh Pokhriyal, through a video conference with all the education ministers of the state, discussed the further steps to be taken to smoothen the education process during the Covid-19 lockdown. The most important topic which was discussed repeatedly on...

Board Exams Class 10 and Class 12 Datesheet 2020

CBSE has announced the datesheet for the remaining exams of class 10 and class 12 exams. The exams are going to start in July. The class 10 and 12th board exams will be conducted for the remaining 29 papers from July 1 to July 15, 2020, at various centers nominated by...

Applied Mathematics Introduced by CBSE as Elective for Class 11 and Class 12

Mathematics Syllabus Revised by CBSE at the Senior Secondary Level! The Central Board of Secondary Education (CBSE) to offer 'Applied Mathematics' as an Elective for XI and XII standard students. The elective subject, Applied Mathematics, is focused at evolving an...

CBSE advisory on student marks

CBSE has issued a public advisory for all students to be careful from unscrupulous persons impersonating themselves as officers/officials of CBSE. These people have been contacting parents and have been telling them that they have access to student marks data for Board...

Live session by CBSE Experts for holistic wellbeing

CBSE and Fit India Mission have collaborated to provide live sessions by experts covering a range of topics for holistic well-being of school going children, which will include simple actionable tips around Basic Exercises, Nutrition, Yoga & Meditation, boosting...

CBSE Recommends Arogya Setu App, Writes To School Principals

Written recommendation from CBSE to school principals for initiating the Arogya Setu App! New Delhi:  The Central Board of Secondary Education has advised all school principals through a written communication recommending the “Arogya Setu App” and Health Ministry's...

×
Studies Today