CBSE Question Paper 2017 class 12 Computer Science

myCBSEguide App

myCBSEguide App

Complete Guide for CBSE Students

NCERT Solutions, NCERT Exemplars, Revison Notes, Free Videos, CBSE Papers, MCQ Tests & more.

Download Now


CBSE Question Paper 2017 class 12 Computer Science conducted by Central Board of Secondary Education, New Delhi in the month of March 2017. CBSE previous year question papers with solution are available in myCBSEguide mobile app and cbse guide website. The Best CBSE App for students and teachers is myCBSEguide which provides complete study material and practice papers to cbse schools in India and abroad.

CBSE Question Paper 2017 class 12 Computer Science

Download as PDF

Class 12 Computer Science list of chapters

  1. Review of Python
  2. Concept of Object Oriented Programming
  3. Classes in Python
  4. Inheritance
  5. Linear List Manipulation
  6. Stacks & Queues in list
  7. Data File Handling
  8. Exception Handling & Green Functions
  9. Databases Concepts and SQL
  10. Structure  Query Language
  11. Boolean Algebra
  12. Boolean Functions & Reduce Forms
  13. Application of Boolean Logic
  14. Networking Concepts  (Part 1)
  15. Networking Concepts  (Part 2)
  16. Networking Protocols
  17. Mobile Telecommunication Technologies, Network Security and Internet Services

CBSE Question Paper 2017 class 12 Computer Science

General Instructions:

  1. SECTION A refers to programming language C++.
  2. SECTION B refers to programming language Python.
  3. SECTION C is compulsory for all.
  4. Answer either SECTION A or SECTION B.
  5. It is compulsory to mention on the page 1 in the answer book whether you are attempting SECTION A or SECTION B.
  6. All questions are compulsory within each section.

(Only for Candidates, who opted for C++)

1. (a) Write the type of C++ tokens (keywords and user defined identifiers) from the following: (2)
(i) For
(ii) delete
(iii) default
(iv) Value
(b) Anil typed the following C++ code and during compilation he found four errors as follows: (1)
(i) Function strlen should have a prototype
(ii) Undefined symbol cout
(iii) Undefined symbol endl
(iv) Function getchar should have a prototype
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 S [ ] = “Hello”;
for (int i = 0; i<strlen(S); i++)
S[i] = S[i]+1;
getchar ( );
(c) Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined. (2)
Note: Assume all required header files are already being included in the program.
void main ( )
cout<<“Enter an integer”;
case 0 cout<<“Even”; Break;
case 1 cout<<“Odd”; Break;
(d) Find and write the output of the following C++ program code: (2)
Note : Assume all required header files are already included in the program.
#define Big(A,B) (A>B)?A+1:B+2
void main()
char W [ ] = “Exam”;
int L=strlen (W);
for (int i=0; i<L–1; i++)
W [i] = Big (W[i],W[i+1]);
(e) Find and write the output of the following C++ program code : (3)
Note : Assume all required header files are already being included in the program.
void main ( )
int A [ ]={10,12,15,17,20,30};
for (int i = 0; i<6; i++)
A[i] /= 2;
else if(A[i]%3==0)
A[i] /= 3;
A[i] /=5;
For (i = 0; i<6; i++)
Cout <<A[i]<<”#”;
(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 R and C. (2)
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 R=random(3),C=random(4);
int MAT[3][3] = {{10,20,30},{20,30,40},{30,40,50}}; for(int I=0; I<R; I++)
For (int J=0; J<C; J++)
Cout <<MAT[I][J]<<” “;

10 20 30
20 30 40
30 40 50
10 20 30
20 30 40
10 20
20 30
10 20
20 30
30 40

2. (a) Differentiate between private and public members of a class in context of Object Oriented Programming. Also give a suitable example illustrating accessibility/nonaccessibility of each using a class and an object in C++. (2)
(b) Observe the following C++ code and answer the questions (i) and (ii).
Note : Assume all necessary files are included.
class EXAM
long Code;
char EName[20];
float Marks;
EXAM() //Member Function 1
EXAM(EXAM &E) //Member Function 2
void main ( )
________ //Statement 1
________ //Statement 2
(i) Which Object Oriented Programming feature is illustrated by the Member Function 1 and Member Function 2 together in the class EXAM ? (1)
(ii) Write Statement 1 and Statement 2 to execute Member Function 1 and Member Function 2 respectively. (1)
(c) Write the definition of a class RING in C++ with following description: (4)
Private Members
– RingNumber // data member of integer type
– Radius // data member of float type
– Area // data member of float type
– Calc Area ( ) // Member function to calculate and assign
// Area as 3.14 ∗Radius∗Radius
Public Members
– Get Area ( ) // A function to allow user to enter values of
// RingNumber and Radius. Also, this
// function should call CalcArea() to calculate
// Area
– ShowArea ( ) // A function to display RingNumber, Radius
// and Area
(d) Answer the questions (i) to (iv) based on the following: (4)
class One
int A1;
float A2;
One ( );
void Get1( ); void Show1( );
class Two: private One
int B1;
float B2;
Two ( );
void Get2 ( );
void Show ( );
Class Three : public Two
int C1;
Three ();
void Get3 ( );
void Show ( );
void main ( )
Three T; //Statement 1
__________; //Statement 2
(i) Which type of Inheritance out of the following is illustrated in the above example?
– Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance
(ii) Write the names of all the member functions, which are directly accessible by the object T of class Three as declared in main ( ) function.
(iii) Write Statement 2 to call function Show ( ) of class Two from the object T of class Three.
(iv) What will be the order of execution of the constructors, when the object T of class Three is declared inside main ( )?
3. (a) Write the definition of a function Reverse(int Arr[], int N) in C++, which should reverse the entire content of the array Arr having N elements, without using any other array. (3)
Example: if the array Arr contains


Then the array should become


Note :
• The function should only rearrange the content of the array.
• The function should not copy the reversed content in another array.
• The function should not display the content of the array.
(b) Write definition for a function ADDMIDROW(int MAT[][10],int R,int C) in C++, which finds sum of the middle row elements of the matrix MAT (Assuming C represents number of Columns and R represents number of rows, which is an odd integer). (2)
For example, if the content of array MAT having R as 3 and C as 5 is as follows:


The function should calculate the sum and display the following :
Sum of Middle Row : 15
(c) T[25][30] is a two dimensional array, which is stored in the memory along the
row with each of its element occupying 2 bytes, find the address of the element
T[10] [15], if the element T[5] [10] is stored at the memory location 25000. (3)
(d) Write the definition of a member function ADDMEM( ) for a class QUEUE in C++, to add a MEMBER in a dynamically allocated Queue of Members considering the following code is already written as a part of the program. (4)
struct Member
int MNO;
char MNAME[20];
Member *Next;
Member *Rear, *Front;
QUEUE ( ) {Rear=NULL;Front=NULL;}
void ADDMEM();
void REMOVEMEM ( );
~QUEUE ( );
(e) Convert the following Infix expression to its equivalent Postfix expression, showing the stack contents for each step of conversion. (2)
P + (Q – R ) * S / T
4. (a) Aditi has used a text editing software to type some text. After saving the article as WORDS.TXT, she realised that she has wrongly typed alphabet J in place of alphabet I everywhere in the article. (3)
Write a function definition for JTOI ( ) in C++ that would display the corrected version of entire content of the file WORDS.TXT with all the alphabets “J” to be displayed as an alphabet “I” on screen.
Note : Assuming that WORD.TXT does not contain any J alphabet otherwise.
Example :
If Aditi has stored the following content in the file WORDS.TXT:


The function JTOI( ) should display the following content:


(b) Write a definition for function COUNTDEPT( ) in C++ to read each object of a binary file TEACHERS.DAT, find and display the total number of teachers in the department MATHS. Assume that the file TEACHERS.DAT is created with the help of objects of class TEACHERS, which is defined below : (2)
int TID; char DEPT[20];
void GET()
void SHOW ( )
char *RDEPT ( ){return DEPT;}
(c) Find the output of the following C++ code considering that the binary file BOOK.DAT exists on the hard disk with a data of 200 books. (1)
class BOOK
int BID;char BName[20];
void Enter ();void Display ( );
void main ( )
fstream InFile;
In File. Open (“BOOK.DAT”,ios :: binary | ios : : in);
In File. Seekg (5*size of (B));
In File. read((char*)&B, size of (B));
cout<<“Book Number:”<<In File. Tell g ( )/size of (B) + 1;
In file. Seekg (0,ios::end);
Cout <<” of “<<In File. tellg ( )/size of (B)<<end1;
In File. close ( );


(Only for Candidates, who opted for Python)
1. (a) Which of the following can be used as valid variable identifier(s) in Python ? (2)
(i) total
(ii) 7Salute
(iii) Que$tion
(iv) global
(b) Name the Python Library modules which need to be imported to invoke the following functions : (1)
(i) ceil ( )
(ii) randint ( )
(c) Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code. (2)
for T in range[0,7]:
print TEXT(T)
print T+TEXT
(d) Find and write the output of the following Python code : (2)
STR = [“90″,”10″,”30″,”40”] COUNT = 3
SUM = 0
for I in [1,2,5,4]:
S = STR[COUNT] SUM = float (S)+I
print SUM
(e) Find and write the output of the following Python code: (3)
class ITEM:
def_ init_(self,I=101, N=”Pen”, Q=10): #constructor
self. I no=I
self. I Name=N
self. Qty = in t (Q);
def Buy (self, Q):
self. Qty = self. Qty + Q
def Sell (self, Q):
self. Qty –= Q
def Show Stock (self):
print self. In o,”:”,self.IName,”#”,self. Qty
I1=ITEM ( )
I1. Buy (10)
I2. Sell (25)
I3. Buy (75)
I3. Show Stock ( )
I1. Show Stock ( )
I2. Show Stock ( )
(f) What are the possible outcome(s) executed from the following code ? Also specify the maximum and minimum values that can be assigned to variable N. (2)
import random
for I in range(N,1,–1):


2. (a) List four characteristics of Object Oriented Programming. (2)
(b) class Test: (2)
rollno = 1
def_init_(self, r, m): #function 1
self. rollno =r
self. marks=m
def assign(self, r, m): #function 2
rollno = n
marks = m
def check(self): #function 3
print self. rollno, self. marks
print rollno, marks
(i) In the above class definition, both the functions – function 1 as well as function 2 have similar definition. How are they different in execution?
(ii) Write statements to execute function 1 and function 2.
(c) Define a class RING in Python with following specifications: (4)
Instance Attributes
– RingID # Numeric value with a default value 101
– Radius # Numeric value with a default value 10
– Area # Numeric value
– Area Cal ( ) # Method to calculate Area as
# 3.14*Radius*Radius
– New Ring ( ) # Method to allow user to enter values of
# RingID and Radius. It should also
# Call Area Cal Method
– View Ring ( ) # Method to display all the Attributes
(d) Differentiate between static and dynamic binding in Python? Give suitable examples of each. (2)
(e) Write two methods in Python using concept of Function Overloading (Polymorphism) to perform the following operations: (2)
(i) A function having one argument as side, to calculate Area of Square as side*side
(ii) A function having two arguments as Length and Breadth, to calculate Area of Rectangle as Length*Breadth.
3. (a) What will be the status of the following list after the First, Second and Third pass of the bubble sort method used for arranging the following elements in descending order? (3)
Note : Show the status of all the elements after each pass very clearly underlining the changes.
152, 104, –100, 604, 190, 204
 (b) Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are odd. (3)
 (c) Write Addnew(Book) and Remove(Book) methods in Python to Add a new Book and Remove a Book from a List of Books, considering them to act as PUSH and POP operations of the data structure Stack. (4)
 (d) Write definition of a Method AFIND(CITIES) to display all the city names from a list of CITIES, which are starting with alphabet A. (2)
For example :
If the list CITIES contains
[“AHMEDABAD”,”CHENNAI”,”NEW DELHI”,”AMRITSAR”,”AGRA”] The following should get displayed
(e) Evaluate the following Postfix notation of expression : (2)
4. (a) Differentiate between file modes r+ and w+ with respect to Python. (1)
(b) Write a method in Phyton to read lines from a text file DIARY.TXT, and display those lines, which are starting with an alphabet ‘P’. (2)
(c) Considering the following definition of class COMPANY, write a method in Python to search and display the content in a pickled file COMPANY.DAT, where CompID is matching with the value ‘1005’. (3)
class Company:
def_ init_(self, CID, NAM):
self. Comp ID = CID # Comp ID Company ID
self. C Name = NAM # C Name Company Name
self. Turnover = 1000
def Display(self):
print self. Comp ID,”:”,self.CName,”:”,self.Tunover


(For all the Candidates)
5. (a) Observe the following table CANDIDATE carefully and write the name of the RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT, which has been used to produce the output as shown in RESULT. Also, find the Degree and Cardinality of the RESULT. (2)




(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables: (6)

F101The priestFiction
L102German easyLiterature
C101Tarzan in the lost worldComic
F102Untold StoryFiction
C102War heroesComic


M101RAGHAV SINHAL1022016-10-13
M103SARTHAK JOHNF1022017-02-23
M102ANISHA KHANC1012016-06-12

(i) To display all details from table MEMBER in descending order of ISSUEDATE.
(ii) To display the BNO and BNAME of all Fiction Type books from the table BOOK.
(iii) To display the TYPE and number of books in each TYPE from the table BOOK.
(iv) To display all MNAME and ISSUEDATE of those members from table MEMBER who have books issued (i.e. ISSUEDATE) in the year 2017.
6. (a) State Distributive Laws of Boolean Algebra and verify them using truth table. (2)
(b) Draw the Logic Circuit of the following Boolean Expression using only NAND Gates:(2)
X.Y + Y.Z
(c) Derive a Canonical SOP expression for a Boolean function F, represented by the following truth table: (1)

U V W F(U,V,W)
0 0 0 1
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0

(d) Reduce the following Boolean Expression to its simplest form using K-Map: (3)
F(X,Y,Z,W) = Σ(0,1,2,3,4,5,10,11,14)91/1 15 [P.T.O.
7. (a) Differentiate between Radio Link and Microwave in context of wireless communication technologies. 2
(b) Amit used a pen drive to copy files from his friend’s laptop to his office computer. Soon his office computer started abnormal functioning. Sometimes it would restart by itself and sometimes it would stop functioning totally. Which of the following options out of (i) to (iv), would have caused the malfunctioning of the computer ? Justify the reason for your chosen option: (2)
(i) Computer Worm (ii) Computer Virus (iii) Computer Bacteria (iv) Trojan Horse
(c) Jai is an IT expert and a freelancer. He recently used his skills to access the Administrator password for the network server of Megatech Corpn Ltd. And provided confidential data of the organization to its Director, informing him about the vulnerability of their network security. Out of the following options (i) to (iv), which one most appropriately defines Jai? (2)
Justify the reason for your chosen option :
(i) Hacker (ii) Cracker (iii) Operator (iv) Network Admin
(d) Hi Speed Technologies Ltd. is a Delhi based organization which is expanding its office setup to Chandigarh. At Chandigarh office campus, they are planning to have 3 different blocks for HR, Accounts and Logistics related work. Each block has number of computers, which are required to be connected in a network for communication, data and resource sharing.
As a network consultant, you have to suggest the best network related solutions for them for issues/problems raised in (i) to (iv), keeping in mind the distances between various blocks / locations and other given parameters.
CBSE Question Paper 2017 class 12 Computer Science
Shortest distances between various blocks/locations:

HR Block to Accounts Block400 metres
Accounts Block to Logistics Block200 metres
Logistics Block to HR Block150 metres
DELHI Head Office to CHANDIGARH Office270 km

Number of Computers installed at various blocks are as follows:

HR Block70
Accounts Block50
Logistics Block40

(i) Suggest the most appropriate block/location to house the SERVER in the CHANDIGARH Office (out of the 3 blocks) to get the best and effective connectivity. Justify your answer. (1)
(ii) Suggest the best wired medium and draw the cable layout (Block to Block) to efficiently connect various Blocks within the CHANDIGARH office compound. (1)
(iii) Suggest a device / software and its placement that would provide data security for the entire network of CHANDIGARH office. (1)
(iv) Which of the following kind of network, would it be? (1)
(a) PAN (b) WAN (c) MAN (d) LAN

These are questions only. To view and download complete question paper with solution install myCBSEguide App from google play store or login to our student dashboard.

Download myCBSEguide App

Last Year Question Paper Class 12 Computer Science 2017

Download class 12 Computer Science question paper with solution from best CBSE App the myCBSEguide. CBSE class 12 Computer Science question paper 2017 in PDF format with solution will help you to understand the latest question paper pattern and marking scheme of the CBSE board examination. You will get to know the difficulty level of the question paper.

Previous Year Question Paper for class 12 in PDF

CBSE question papers 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005 and so on for all the subjects are available under this download link. Practicing real question paper certainly helps students to get confidence and improve performance in weak areas.

To download CBSE Question Paper class 12 Accountancy, Chemistry, Physics, History, Political Science, Economics, Geography, Computer Science, Home Science, Accountancy, Business Studies and Home Science; do check myCBSEguide app or website. myCBSEguide provides sample papers with solution, test papers for chapter-wise practice, NCERT solutions, NCERT Exemplar solutions, quick revision notes for ready reference, CBSE guess papers and CBSE important question papers. Sample Paper all are made available through the best app for CBSE students and myCBSEguide website.

Test Generator

Test Generator

Create Papers with your Name & Logo

Try it Now (Free)

Leave a Comment