# CBSE Computer Science Sample Papers Class 12

Mar 16 • Board Sample Papers • 3829 Views • 1 Comment on CBSE Computer Science Sample Papers Class 12

Central Board of Secondary Education is abbreviated as C.B.S.E. which the finest self-financing Educational Board of Education that is serving quality education to both private as well as publics school across the country. Every year CBSE is conducting Board examinations for Class 10 and Class 12 students respectively. Thus performance in these exams is essential as they made the base of your career. While preparing for Computer Science subject, students generally confused about the type of questions that comes in the exams. Thus the purpose of setting this Computer Science Sample Papers Class 12 is to make you aware the pattern of the paper which will help you get excellent marks in your board exams.

CBSE Computer Science Sample Papers

Computer Science is the most difficult subject as per exam point of view as it includes various logics, algorithms and the most important coding part. These topic demands more attentions when you prepare this subject. This Sample Paper for Computer Science is prepared to help you in this regard.

CBSE XII Computer Science Sample Papers

General Instructions
1) This paper is of 70 marks
2) This paper consists of Question-1 to Question-7
3) Marks are allotted to each question separately.
4) Internal Choices are provided wherever required.

Question-1

1. (a) Explain as per instructions: [2 Marks]

Write the prototype of a function named Area, which take a float as value parameter and return a double type value. The parameter should have a default value 5.2.

1. (b) Write the names of the header files to which the following belong: [1 Marks]
i) puts()
ii) sin()

1. (c) Rewrite the following program after removing the syntactical error(s) if any. Underline each correction. [2 Marks]
Code:
#include
void main()
{
First=10, Second=20;
Jumpto(First; Second);
Jumpto(second);
}
void Jumpto(int N1, int N2=20)
{
N1=N1+N2;
cout>>N1>>N2
}

1. d) Write the names of the header files which are not necessary to execute the following C++ code.  [3 Marks]
Code:
#include
#include
#include
#include
#include void main()
{ char c, String[ ] = ” System Design “;
for(int i=0; String[i]!=” ;i++)
if(isdigit(String[i])
cout<<endl;
else
{
c=toupper(String[i]);
cout<<c;
}
}

1. e) Find output of the following program segment: [2 Marks]
Code:
int A[][4] = {{11,21,32,43}, {20,30,40,50}};
for (int i = 1; i<2; i++)
for (int j = 0; j<4; j++)
cout<<A[i][j]<<“*\n”;

f) Find output of the following program segment:  [2 Marks]
Code:
int a = 5;
void demo(int x, int y, int &z)
{ a += x+y;
z = a+y;
y += x;
cout<<x<<‘*'<<y<<‘*'<<z<<endl;
}
void main()
{ int a = 3, b = 4;
demo(::a,a,b);
demo(::a,a,b);
}

Question-2

2. a) Write a function to accept three integers and return the smallest of three numbers (use conditional operator)   [2 Marks]

2. b) What is the similarity and difference between break and continue statements?
i)
Give the output of the following program:  [3 Marks]

Code: #include<iostream.h>
int g=20;
void Func(int &x, int y)
{
x=x-y;
y=x*10;
cout<<x<<’,’<<y<<”\n”;
}
void main()
{
int g=7;
Func(g,::g);
cout<<g<<’,’<<::g<<’\n’;
Func(::g,g);
cout<<g<<’,’<<::g<<’\n’;
}

2. c) Differentiate between a Run Time Error and Syntax Error. Also give suitable examples of each in C++. [2 Marks]

2. d) Write a function SWAP2BEST (int ARR[], int Size) in C++ to modify the content of the array in such a way that the elements, which are multiples of 10 swap with the value present in the very next position in the array. For example : If the content of array ARR is  80, 66, 45, 20, 44, 54 The content of array ARR should become 56, 80, 45, 44, 20, 54  [4 Marks]

Question-3

3. a) An array T[20][10] is stored in the memory along the column with each of the elements occupying 2 bytes. Find out the memory location of T[10l[15], if the element T[3][9] is stored at the location 7800. [1 Marks]

3. b) Write a function in C++ to perform Insert operation in a static circular Queue containing Book’s information (represented with the help of an array of structure BOOK).  [2 Marks]
Code: Struct BOOK
{
int bookno;
char Title[20];
};

3. c) Write a function CHANGE( ) in C++, which accepts a 2d array of integer and its size as parameters and divide all those array elements by 7 which are not in the range 70 to 700 and find the square root of all other elements. [3 Marks]

or

3. d) Evaluate the following postfix expression.
2, 3, ^, 4, 5,-, 6,*, /

3. e) Observe the program segment given below carefully and fill in the blanks marked as Line 1 and Line 2 using fstream functions for performing the required task. 1  [4 Marks]
Code: #include
class Library
{
long Ano; //Ano- Accession Number of the Book
char Title[20]; //Title- Title of the Book
int Qty; //Qty- Number of Books in Library
public:
void Enter(int); //Function to enter the content
void Display(); // Function to display the content
{
Qty+=Tqty;
} //Function to increment in Qty
long GetAno() {return Ano;}
};
//BaNo-> Ano of the book purchased
//QBty-> Number of books purchased
{
fstream File;
File.open(“STOCK.Dat”, ios :: binary|ios::in|ios::out);
int Position=-1;
Library L;
if(L.GetAno()==BAno)
{L.Buy(BQty); //To update the number of Books
Position = File.tellg( )-sizeof(L);
//Line1: To place the file pointer to the required position;
_________;
//Line 2: To write the object L on to the binary file
_________;
}
if (Position == -1)
cout<< “No updation done as required Ano no found.”;
File.close();
}

Question-4

4. (a)State and prove the De-Morgan’s Theorem (Any One) algebraically.  [2 Marks]

b) Draw a Logical Circuit Diagram using NAND gates for the following Boolean Expression:A.(B+C’) [2 Marks]

c) State Duality Principle. Give the dual of (A+BC+AB)  [1 Marks]

d) Obtain a simplified from for a Boolean expression: [4 Marks]
F (U, V, W, Z) = II (0, 1, 3, 5, 6, 7, 10, 14, 15)

Question-5

5. a) Verify the following using Truth Table:X+Y.Z=(X+Y).(X+Z)   [2 Marks]

(b) Write the SOP form of a Boolean Function F, which is represented in a truth table as follows:[4 Marks]

 X Y Z F 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1

(C) Reduce the following Boolean Expression using K-Map:F(A,B,C,D)= S(2,3,4,5,6,7,8,10,11) [2 Marks]

Question-6

6. a) What is cardinality and degree explain with an example.  [1 Marks]
b) Consider the following tables WORKER and PAYLEVEL and answer (b) and (c) parts of this question:  [4 Marks]
Table: WORKER

 ECODE NAME DESIG PLEVEL DOJ DOB 11 Radhey Shyam Supervis P001 13-Sep-2004 23-Aug-1981 12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987 13 Fizza Operator P003 14-Jun-2009 14-Oct-1983 15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984 18 Sanya Clerk P002 19-Dec-2005 09-Jun-1983

Table: PAYLEVEL

 PLEVEL PAY ALLOWANCE P001 26000 12000 P002 22000 10000 P003 12000 6000

(b) Write SQL commands for the following statements:  [2.5 Marks]
(i) To display the details of all Workers, descending order of DOB.
(ii) Write a command to delete the records of workers having name starts with ‘F’.
(iii) Write a command to modify the records of by adding their pay by 1000 having allowance>10000.
(iv) To add a new row with the following :
19 “Kishore‟, “Operator‟, “P003‟. “19-Jun-2008‟, “11-Jul-1984‟
(v) write a command to display the name, designation of workers having pay+allowance <30000
(vi) write a command to delete all the records of worker table with all its contents and structure.

(c) Give the output of the following SQL queries :   [2.5 Marks]
(i) SELECT COUNT (PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL;
(ii) SELECT MAX(DOB), MIN(DOJ) FROM WORKER;
bSELECT Name, Pay FROM WORKER W, PAYLEVEL P WHERE W.PLEVEL = S.PLEVEL AND P.ECODE<13;
(iii) SELECT PLEVEL, PAY+ALLOWANCE FROM PAYLEVEL WHERE PLEVEL = ‘P003’;

Question-7

7.a) Write a function COUNT_TO( ) in C++ to count the presence of a word “to” (independent word only) in a text file “NOTES.TXT”  [4 Marks]
Example:
If the content of the file “NOTES.TXT” is a follows:
It is very important to know that
Smoking is injurious to health.
Let us take initiative to stop it.
The function COUNT_TO( ) will display the following message:
Count of – to- in file: 3
Note: In the above example, ‘to’ occurring as a part of word stop is not considered.

7. b) Write a function in C++ to search for a Toy having a particular Toy Code (Tcode) from a binary file “TOY.DAT” and display its details (Tdetails), assuming the binary file is containing the objects of following class: 3  [4 Marks]
Code: class TOYSHOP
{
int Tcode; //Toy Code
char Tdetails[20];
public:
int RTcode()
{
return Tcode;
}
{cin>>Tcode;gets(Tdetails);}
void DisToy()
{cout<<Tcode<<Tdetails<<endl;}
};

7. c) Write a udf in c++ to find the count the middle character of the words in text file “MYDATA.txt”
Having value ‘D’ or ‘d’.  [3 Marks]

or

7. d) Write a statement using seekg,tellg, seekp, tellp to set the position of reading object after the 5th object of the class BANK. Write the second statement to find the byte position after writing the 5th object. [3 Marks]

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

You may like to visit:

Computer Science

Maths:

Science:

### One Response to CBSE Computer Science Sample Papers Class 12

1. sakshi chaudhary says:

The write up basically deals with the important questions for Class 12th students in Computer Science.
So, have a look and solve out the questions to check out your preparation for Board Exam which will help you to find your week topic which needs practice..!!!