CBSE Sample Paper for Computer Science Class XII

Mar 15 • Board Sample Papers • 16594 Views • 20 Comments on CBSE Sample Paper for Computer Science Class XII

CBSE is one of the most famous self-financing Board of Education that maintains standards of quality education across the country. CBSE stands for Central Board of Secondary Education. The CBSE conducts Board Exams every year for the Class XII and X students respectively. Computer Science is one of the most interesting subjects for the purpose of exam point of view. In order to prepare this subject one should give proper attention to each and every concept behind the logics, algorithms and the most important coding part. This Sample Paper for Computer Science is prepared to help you in order to get good marks in the exams.

cbse computer science question paper

CBSE Sample Paper for Computer Science Class XII

I am setting this CBSE Class 12 Question Paper of Computer Science to guide you about the types of questions asked in the CBSE Board Exams and the paper pattern. So, be ready and start practicing.

CBSE Board Sample Paper for Class 12 Computer Science
Time allowed : 3 hours
Maximum marks : 70

General Instructions:
a) This paper consist question from 1 to 7.
b) Marks are mentioned to each questions for your convenience.
c) The given paper is of total 80 marks.
d) Remaining 30 marks is for Practical Exam.

Question-1
1. (a) Define Multilevel and Multiple Inheritance with example . [ 2 Mark]

(b) Define a class ELECTION in C++ with the following descriptions: Write a suitable main ( ) function also to declare 3 objects of ELECTION type and find the winner and display the details .[ 4 Mark]
Private members :
Data : candidate_name , party , vote_received
Public members :
Functions: Enterdetails ( ) – To input data Display ( ) – To display the details of the winner Winner ( ) – To return the details of the winner trough the object after comparing the votes received by three candidates .

(c). Answer the questions (i) to (iv) based on the following code: [ 4 Mark]
class RED
{
char n [ 20 ];
void input ( );
protected :
int x , y ;
void read ( );
public :
RED ( );
RED ( int a );
void get_red ( );
void put_red ( );
};
class WHITE : protected RED
{
void a , b ;
protected :
int c , d ;
void get_white( );
public:
WHITE ( );
Void put_white ( );
};
class BLACK : private WHITE
{
void * p ;
char st[20];
protected :
int q;
void get_black( );
public:
BLACK ( );
void put_black ( );
}ob;

i. Name the data members and functions which are accessible by the objects of class BLACK.
ii. Give the size of object ob
iii. Name the OOPS concept implemented above and its type .
iv. Name the members accessible by function get_black( );

Question-2
2. (a) What do you understand by Data Encapsulation and Data Hiding? Also, give a suitable C++ code to illustrate both. [ 4 Mark]

(b) Answer the questions (i) and (ii) after going through the following class: [6 Mark]
class Seminar
{
int Time;
public:
Seminar() //Function 1
{
Time=30;cout<<“Seminar starts now”<<end1;
}
void Lecture() //Function 2
{
cout<<“Lectures in the seminar on”<<end1;
}
Seminar(int Duration) //Function 3
{
Time=Duration;cout<<“Seminar starts now”<<end1;
}
~Seminar()
//Function 4
{
cout<<“Vote of thanks”<<end1;
}
};
i) In Object Oriented Programming, what is Function 4 referred as and when does it get invoked/called?
ii) In Object Oriented Programming, which concept is illustrated by Function 1 and Function 3 together? Write an example illustrating the calls for these functions.

Question-3
3. (a) Write a function in C++ to merge the contents of two sorted arrays A & B into third array C. Assuming array A and B are sorted in ascending order and the resultant array C is also required to be in ascending order.  [3 Mark]

(b) An array S[40][30] is stored in the memory along the row with each of the element occupying 2 bytes, find out the memory location for the element S[20][10], if the Base Address of the array is 5000. [3 Mark]

(c) Write a function in C++ to perform Insert operation in a dynamically allocated Queue containing names of students. [3 Mark]

(d) Write a function in C++ to find the sum of both left and right diagonal ele-ments from a two dimensional array (matrix). [3 Mark]

(e) Evaluate the following postfix notation of expression: 20, 30, +, 50, 40, – ,* [3 Mark]

Question-4
4. (a) Write a function in C++ to delete a name from a list of names.  [4 Mark]

(b) An array A[13][14] is stored in the memory along the column with each element occupying 4 bytes. Find out the Base address and address of the element A[3][7] if the element A[4][4] is stored at the address 1300.  [4 Mark]

(c) Consider the following portion of a program , which implements names queue for Books. Write the definition of function Insert(), to insert a new node in the queue with required information.  [4 Mark]
struct Book
{
char names[4][20];
};
class QueueofBooks
{
Book Q[10];
public :
int front ,rear;
QueueofBooks()
{
front=rear=-1;
}
void Insert();
void Delete();
};

(d) Evaluate the following postfix expression using a stack and show the contents of stack after execution of each operation: A-B+C*D^E*G/H  [3 Mark]

Question-5
5.(a) What is the difference between Auto variables and Static variables? Give an example to illustrate the same.  [4 Mark]

(b) Name the header files for the following functions [4 Mark]
(1) cgets
(2) floor
(3) isalpha
(4) gets

(c) In the following C++ program what is expected value of myscore from options (i) to (iv) given below. [1 Mark]
#include
#include
void main( )
{
randomize( );
int score[]={ 25, 20,34,56, 72, 63};
int myscore=score[2+random(2)];
cout<<myscore<<endl;
}

i) 25 ii) 34 iii) 20 iv) None of these

(d)Give the output of the following program (Assuming all required header files are included in the program ). [3 Mark]
void swap(char &c1,char &c2)
{ char temp;
temp=c1;
c1=c2;
c2=temp;
}
void update(char *str)
{ int k,j,l1,l2;
l1 = (strlen(str)+1)/2;
l2=strlen(str);
for(k=0,j=l1-1;k<j;k++,j–)
{
if(islower(str[k]))
swap(str[k],str[j]);
}
for(k=l1,j=l2-1;k<j;k++,j–)
{
if(isupper(str[k]))
swap(str[k],str[j]);
}
}

void main()
{
char data[100]={“gOoDLUck”};
cout<<“Original Data : “<<data<<endl;
update(data);
cout<<“Updated Data “<<data;
}

(e) Give the output of the following program segment : [3 Mark]
void main()
{ int x[] = { 11,22, 33, 55, 112};
int *p = x ;
while(*p<110) { if(*p%3 !=0) *p=*p+1 ; else *p=*p+2 ; P++ ; } for( int i=4 ;i>=1 ;i–)
{ cout<<x[i]<< ‘*’ ;
if(i%3= =0 )
cout< } cout<<x[0]*3< }

Question-6
6. (a) What is the difference between Global Variable and Local Variable? Also, give a suitable C++ code to illustrate both.  [2 Mark]

(b) Which C++ header file(s) will be essentially required to be included to run / execute the following C++ code: [1 Mark]
void main()
{
char Msg[ ]=”Sunset Gardens”;
for (int I=5;I<strlen(Msg);I++) puts(Msg); } (c) Rewrite the following program after removing the syntactical errors (if any). Underline each correction. #include [iostream.h] class MEMBER { int Mno;float Fees; PUBLIC: void Register(){cin>>Mno>>Fees;}
void Display{cout<<Mno<<” : “<<Fees<<endl;}
};
void main()
{
MEMBER M;
Register();
M.Display();
}

(d) Find the output of the following program: [2 Mark]
#include
struct GAME
{ int Score, Bonus;};
void Play(GAME &g, int N=10)
{
g.Score++;g.Bonus+=N;
}
void main()
{
GAME G={110,50};
Play(G,10);
cout<<G.Score<<“:”<<G.Bonus<<endl;
Play(G);
cout<<G.Score<<“:”<<G.Bonus<<endl;
Play(G,15);
cout<<G.Score<<“:”<<G.Bonus<<endl;
}

(e) Find the output of the following program: [2 Mark]
#include
void Secret(char Str[ ])
{
for (int L=0;Str[L]!=”;L++);
for (int C=0;C<L/2;C++)
if (Str[C]==’A’ || Str[C]==’E’)
Str[C]=’#’;
else
{
char Temp=Str[C];6
No. Questions Marks
Str[C]=Str[L-C-1];
Str[L-C-1]=Temp;
}
}
void main()
{
char Message[ ]=”ArabSagar”;
Secret(Message);
cout<<Message<<endl;
}

(f) In the following program, if the value of Guess entered by the user is 65, what will be the expected output(s) from the following options (i), (ii), (iii) and (iv)?  [2 Mark]
#include
#include
void main()
{
int Guess;
randomize();
cin>>Guess;
for (int I=1;I<=4;I++)
{
New=Guess+random(I);
cout<<(char)New;
}
}
(i) ABBC
(ii) ACBA
(iii) BCDA
(iv) CABD7

NOTE:
To get pdf of above sample paper, follow: CBSE Sample Paper for Computer Science Class XII
To get pdf of more CS sample paper, follow: Computer Science 12th CBSE Sample Papers

The above CBSE Computer Science Question Paper is made for the appearing students. I hope this will help you to enhance Exam preparation by solving this. Please follow the comment section given below the post for any kind of suggestion related to the content of paper.
All the Best….!!

You may also like to visit following resources for your Board Exams:
Computer Science:
Sample Paper Computer Science Class 12
Class 12 CBSE Model Question Paper CS
CBSE Computer Science Sample Papers Class 12

Science:
CBSE Biology Sample Papers for Class 12th
CBSE 12th Physics Sample Paper
CBSE Sample Paper for Class 12  Biology 
CBSE 12th Chemistry Sample Paper

Maths:
CBSE Sample papers for Class 12 Maths
Sample paper for Mathematics CBSE Class 12

Tell us Your Queries, Suggestions and Feedback

Your email address will not be published.

20 Responses to CBSE Sample Paper for Computer Science Class XII

  1. Anonymous says:
  2. rohit says:

    prepration for board examination

  3. rohit says:

    prepration for board examination

  4. rohit says:

    prepration for board examination

  5. rohit says:

    prepration for board examination

  6. rohit says:

    prepration for board examination

  7. rohit says:

    prepration for board examination

  8. rohit says:

    prepration for board examination

  9. rohit says:

    prepration for board examination

  10. rohit says:

    prepration for board examination

  11. rohit says:

    prepration for board examination

  12. rohit says:
  13. Anonymous says:
  14. srikrishna says:

    some very very important questions for board exam 2018 cbse

  15. srikrishna says:
  16. Required CBSE Sample Papers says:

    Thanks a lots sneha nanda for posting the sample papers of computer science. I wanted to CBSE Sample papers for class 12th for 2017 & 18 please.

  17. Ranjana Singh says:

    Computer

  18. Madhuri Kabita soreng says:

    I am a PGT Comp. Science Teacher, i need study material 2016-2017 for class 11 cbse

  19. sarika says:

    is it necessary that answers to functions in question no. 3 should be same according to anser key of board.

  20. Dinesh says:

    the questions which you have posted here was very good very neatly aligned easy to read

« »