CBSE Class 12 Computer Science Question Paper 2017: All India

Aug 10, 2017 14:00 IST

CBSE Class 12 Computer Science Question Paper 2017: All India

CBSE Class 12 Computer Science board exam 2017 question paper (All India, Set 4) is available here for download in PDF format. From this article, students can download the complete question with the help of download link given at the end of this article. This paper is very helpful for the students preparing for CBSE Class 12 board exam 2018. With this paper, students can easily understand the level of questions which are asked in CBSE Class 12 Computer Science board exam.

Some sample questions from the question paper are given below:

Question: (a) Write the type of C++ tokens (keywords and user defined identifiers) from the following:

(i) new

(ii) While

(iii) case

(iv) Num_2

CBSE Board Exam 2017: Class 12 Maths Paper Analysis

CBSE Board Exam 2017: Class 12 English Paper Analysis

CBSE Board Exam 2017: Class 12 Business Studies Paper Analysis

(b) Anil typed the following C++ code and during compilation he found three errors as follows :

(i) Function strlen should have prototype

(ii) Undefined symbol cout

(iii) Undefined symbol endl

On asking, his teacher told him to include necessary header files in the code. Write the names of the header files, which Anil needs to include, for successful compilation and execution of the following code:

void main()

{

char Txt[] = "Welcome";

for(int C= 0; C<strlen(Txt); C++)

Txt[C] = Txt[C]+1;

cout<<Txt<<endl;

}

(c) Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined.

Note : Assume all required header files are already being included in

the program.

void main()

{

cout<<"Enter an Alphabet:";

cin>>CH;

switch(CH)

case „A‟ cout<<"Ant"; Break;

case „B‟ cout<<"Bear" ; Break;

}

(d) Find and write the output of the following C++ program code:

Note: Assume all required header files are already included in the program.

#define Diff(N1,N2) ((N1>N2)?N1-N2:N2-N1)

void main()

{

int A,B,NUM[] = {10,23,14,54,32};

for (int CNT =4; CNT>0; CNT--)

{

A=NUM[CNT];

B=NUM[CNT-1];

cout<<Diff(A,B)<<'#';

}

}

(e) Find and write the output of the following C++ program code:

Note: Assume all required header files are already being included in the program.

void main()

{

int *Point, Score[]={100,95,150,75,65,120};

Point = Score;

for(int L = 0; L<6; L++)

{

if((*Point)%10==0)

*Point /= 2;

else

*Point -= 2;

if((*Point)%5==0)

*Point /= 5;

Point++;

}

for(int L = 5; L>=0; L--)

cout<<Score[L]<<"*";

}

(f) Look at the following C++ code and find the possible output(s) from the options (i) to (iv) following it. Also, write the maximum values that can be assigned to each of the variables N and M.

Note:  Assume all the required header files are already being included in the code.

• The function random (n) generates an integer between 0 and n – 1.

void main()

{

randomize();

int N=random(3),M=random(4);

int DOCK[3][3] = {{1,2,3},{2,3,4},{3,4,5}};

for(int R=0; R<N; R++)

{

for(int C=0; C<M; C++)

cout<<DOCK[R][C]<<" ";

cout<<endl;

}

}

(i)

(ii)

1    2    3

2    3    4

3    4    5

1    2    3

2    3    4

(iii)

(iv)

1    2

2    3

1    2

2    3

3    4

CBSE Board Exam 2017: Class 12 Chemistry Paper Analysis and Review

Question: (a) Polina Raj has used a text editing software to type some text in an article. After saving the article as MYNOTES.TXT, she realised that she has wrongly typed alphabet K in place of alphabet C everywhere in the article.

Write a function definition for PURETEXT() in C++ that would display the corrected version of the entire article of the file

MYNOTES.TXT with all the alphabets ――K‖‖ to be displayed as an alphabet ――C‖‖ on screen.

Note: Assuming that MYNOTES.TXT does not contain any C alphabet otherwise.

Example:

If Polina has stored the following content in the file MYNOTES.TXT:

I OWN A KUTE LITTLE KAR.

I KARE FOR IT AS MY KHILD.

The function PURETEXT() should display the following content:

I OWN A CUTE LITTLE CAR.

I CARE FOR IT AS MY CHILD.

(b) Write a definition for function COUNTPICS( ) in C++ to read each object of a binary file PHOTOS.DAT, find and display the total number of PHOTOS of type PORTRAIT. Assume that the file PHOTOS.DAT is created with the help of objects of class PHOTOS, which is defined below:

class PHOTOS

{

int PCODE;

char PTYPE[20];//Photo Type as “PORTRAIT”,“NATURE”

public:

void ENTER()

{

cin>>PCODE;gets(PTYPE);

}

void SHOWCASE()

{

cout<<PCODE<<":" <<PTYPE<<endl;

}

char *GETPTYPE(){return PTYPE;}

};

(c) Find the output of the following C++ code considering that the binary file CLIENTS.DAT exists on the hard disk with a data of 200 clients:

class CLIENTS

{

int CCode;char CName[20];

public:

void REGISTER(); void DISPLAY();

};

void main()

{

fstream File;

File.open("CLIENTS.DAT",ios::binary|ios::in);

CLIENTS C;

File.seekg(6*sizeof(C));

File.read((char*)&C, sizeof(C));

cout<<"Client Number:"<<File.tellg()/sizeof(C) + 1;

File.seekg(0,ios::end);

cout<<" of "<<File.tellg()/sizeof(C)<<endl;

File.close();

}

Download CBSE Class 12 Computer Science Question Paper 2017 (All India) in PDF format

Show Full Article

Post Comment

Register to get FREE updates

All Fields Mandatory
  • Please Select Your Interest
  • By clicking on Submit button, you agree to our terms of use
  • A verifcation code has been sent to
    your mobile number

    Please enter the verification code below

X

Register to view Complete PDF

Newsletter Signup

Copyright 2017 Jagran Prakashan Limited.