1. Home
  2. /
  3. CBSE
  4. /
  5. Class 12
  6. /
  7. Computer Science
  8. /
  9. CBSE Question Paper 2016...

CBSE Question Paper 2016 class 12 Computer Science

myCBSEguide App

myCBSEguide App

Download the app to get CBSE Sample Papers 2023-24, NCERT Solutions (Revised), Most Important Questions, Previous Year Question Bank, Mock Tests, and Detailed Notes.

Install Now

CBSE Question Paper 2016 class 12 Computer Science conducted by Central Board of Secondary Education, New Delhi in the month of March 2016. 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 2016 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 2016 class 12 Computer Science

General Instructions:

• The answers given in the marking scheme are SUGGESTIVE, Examiners are requested to award marks for all alternative correct Solutions/Answers conveying the similar meaning
• All programming questions have to be answered with respect to C++ Language / Python only
• In C++ / Python, ignore case sensitivity for identifiers (Variable / Functions / Structures / Class Names)
• In Python indentation is mandatory, however, number of spaces used for indenting may vary
• In SQL related questions – both ways of text/character entries should be acceptable for Example: “AMAR” and ‘amar’ both are acceptable.
• In SQL related questions – all date entries should be acceptable for Example: ‘YYYY-MM-DD’, ‘YY-MM-DD’, ‘DD-Mon-YY’, “DD/MM/YY”, ‘DD/MM/YY’, “MM/DD/YY”, ‘MM/DD/YY’ and {MM/DD/YY} are correct.
• In SQL related questions – semicolon should be ignored for terminating the SQL statements
• In SQL related questions, ignore case sensitivity.


SECTION A
(Only for candidates, who opted for C++)

1. (a) Out of the following, find those identifiers, which cannot be used for naming Variable, Constants or Functions in a C++ program: (2)
_Cost, Price*Qty, float, Switch,
Address One, Delete, Numberl2, do

(b) Jayapriya has started learning C++ and has typed the following program. When she compiled the following code written by her, she discovered that she needs to include some header files to successfully compile and execute it. Write the names of those header files, which are required to be included in the code. (1)
void main()
{
float A, Number, Outcome;
cin>>A>>Number;
Outcome=pow(A, Number);
cout<<Outcome<<endl;
}

(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.
#define Equation(p,q) = p+2*q
void main ()
{
float A=3. 2; B=4.1;
C=Equation (A, B);
cout<<‘Output='<<C<<endl;
}

(d) Find and write the output of the following C++ program code: Note: Assume all required header files are already included in the program. (2)
type def char STRING [80];
void MIXITNOW (STRING S)
{
int Size=strlen(S);
for (int I=0;I<Size-l;I+=2)
{
char WS=S [ I ] ;
S[I]=S[1+1] ;
S[I+l]=WS;
}
for (I=l; I< Size; I+=2)
if (S[I]>=’M’ && S[I]<=’U’)
S[I]=’@’;
}
void main ()
STRING Word=”CRACKAJACK”;
MIXITNOW(Word); cout<<Word<<endl;
/> Stock A, B, C;
A. RegCode (1024,150);
B. RegCode (2015,300);
B. Change (10 0,2 9);
C. Change (-20,2 0);
A. Show();
B. Show();
C. Show();
}

(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 and the minimum values that can be assigned to the variable CHANGER. (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 CHANGER;
CHANGER=random(3);
char CITY [] [25]={“DELHI”,”MUMBAI”,”KOLKATA” ,”CHENNAI”};
for(int I=O;I<=CHANGER;1++)
{
for(int J=0;J<=I;J++)
cout<<CITY[J];
cout<<endl;
}
}

(i)(ii)
DELHI
DELHIMUMABAI
DELHIMUMABAIKOLKATA
DELHI
DELHIMUMABAI
DELHIMUMABAIKOLKATA
DELHIMUMABAIKOLKATACHENNAI
(iii)(iv)
MUMABAI
MUMABAIKOLKATA
MUMABAIKOLKATACHENNAI
KOLKATA
KOLKATACHENNAI

2. (a) Differentiate between Constructor and Destructor functions giving suitable example using a class in C++. When does each of them execute? (2)
PART 2:
Execution of Constructor and Destructor:

ConstructorDestructor
A constructor executes by itself at the time of object creationA destructor executes by itself when the scope of an object ends

PART 1:
(1 Mark for correct example of constructor and destructor function)
OR
(1/2Mark each for correct definition of constructor and destructor function)

PART 2:
(1 Mark for constructor and Destructor execution with/without example)
(b) Observe the following C++ code and answer the questions (i) and (ii). Assume all necessary files are included:
class FICTION
{
long FCode;
char FTitle[20];
float FPrice;
public:
FICTION () //Member Function 1
{
cout<<“Bought”<<endl;
FCode=100; strcpy(FTitle,”Noname”); FPrice=50;
}
FICTION(int C,char T[],float P) //Member Function 2
{
FCode=C;
strcpy(FTitle,T);
FPrice=P;
}
void Increase (float P) //Member Function 3
{
FPrice+=P;
}
void Show () //Member Function 4
{
cout<<FCode<<“:”<<FTitle<<“:”<<FPrice<<endl;
}
~FICTION () //Member Function 5
{
cout<<“Fiction removed!”<<endl;
}
};
void main () //Line 1
{ //Line 2
FICTION Fl,F2(101,”Dare”,75); //Line 3
for (int I=0;I<4;I++) //Line 4
{ //Line 5
Fl.Increase(20);F2.Increase(15); //Line 6
Fl.Show();F2.Show(); //Line 7
} //Line 8
} //Line 9

(i) Which specific concept of object oriented programming out of the following is illustrated by Member Function 1 and Member Function 2 combined together? (1)
• Data Encapsulation
• Data Hiding
• Polymorphism
• Inheritance

(ii) How many times the message “Fiction removed!” will be displayed after executing the above C++ code? Out of Line 1 to Line 9, which line is responsible to display the message “Fiction removed! “? (1)
(c). Write the definition of a class METROPOLIS in C++ with following description: Private Members (4)
– Mcode //Data member for Code (an integer)
– MName //Data member for Name (a string)
– MPop //Data member for Population (a long int)
– Area //Data member for Area Coverage (a float)
– PopDens //Data member for Population Density (a float)
– CalDen() //A member function to calculate
//Density as PopDens/Area

Public Members
– Enter () //A function to allow user to enter values of
//Mcode, MName, MPop, Area and call CalDen()
//function
– ViewALL () //A function to display all the data members
//also display a message “Highly Populated Area”
//if the Density is more than 12000
(d). Answer the questions (i) to (iv) based on the following: (4)

class PRODUCT
{
int Code;
char Item[20];
protected:
float Qty;
public:
PRODUCT();
void GetIn(); void Show();
} ;
class WHOLESALER
{
int WCode;
protected:
char Manager[2 0];
public:
WHOLESALER();
void Enter();
void Display();
} ;
class SHOWROOM : public PRODUCT, private WHOLESALER
{
char Name[20],City[20];
public:
SHOWROOM();
void Input();
void View();
} ;

(i) Which type of Inheritance out of the following is illustrated in the above example?
– Single Level Inheritance
– Multi Level Inheritance
– Multiple Inheritance
(ii) Write the names of all the data members, which are directly accessible from the member functions of class SHOWROOM.
(iii) Write the names of all the member functions, which are directly accessible by an object of class SHOWROOM.

(iv) What will be the order of execution of the constructors, when an object of class SHOWROOM is declared?
3. (a) Write the definition of a function FixPay(float Pay[], int N) in C++, which should modify each element of the array Pay having N elements, as per the following rules: (2)

Existing Value of PayPay to be changed to
If less than 100000Add 25% in the existing value
If >=100000 and <20000.Add 20% in the existing value
If >=200000Add 15% in the existing value

(b). T[20][50] is a two dimensional array, which is stored in the memory along the row with each of its element occupying 4 bytes, find the address of the element T[15][5], if the element T[10][8] is stored at the memory location 52000. (3)

(C). Write the definition of a member function INSERT() for a class QUEUE in C++, to insert an ITEM in a dynamically allocated Queue of items considering the following code is already written as a part of the program. (4)
struct ITEM
{
int INO; char INAME[20];
ITEM *Link;
};
class QUEUE
{
ITEM *R,*F;
public:
QUEUE(){R=NULL;F=NULL;}
void INSERT();
void DELETE();
~QUEUE();
};
(d). Write definition for a function SHOWMID(int P[][5],int R,int C) in C++ to display the elements of middle row and middle column from a two dimensional array P having R number of rows and C number of columns. (3)
For example, if the content of array is as follows:

115112116101125
103101121102101
185109109160172

The function should display the following as output:
103 101 121 102 101 116 121 109

(e). Convert the following Infix expression to its equivalent Postfix expression, showing the stack contents for each step of conversion. (2)
A/(B+C)*D-E

4. (a) Write function definition for WORD4CHAR() in C++ to read the content of a text file FUN.TXT, and display all those words, which has four characters in it. (2)
Example:
If the content of the file fun.TXT is as follows:

When I was a small child, I used to play in the garden with my grand mom. Those days were amazingly funful and I remember all the moments of that time

The function WORD4CHAR() should display the following:

When used play with days were that time

(b). Write a definition for function BUMPER( ) in C++ to read each object of a binary file GIFTS.DAT, find and display details of those gifts, which has remarks as “ON DISCOUNT”. Assume that the file GIFTS.DAT is created with the help of objects of class GIFTS, which is defined below: (3)
class GIFTS
{
int ID;char Gift[20],Remarks[20]; float Price;
public:
void Takeonstock()
{
cin>>ID;gets(Gift);gets(Remarks);cin>>Price;
}
void See()
cout<<ID<<“:”<<Gift<<“:”<<Price<<“”:”<<Remarks<<endl;
}
char *GetRemarks(){return Remarks;}
};
(C). Find the output of the following C++ code considering that the binary file MEM.DAT exists on the hard disk with a data of 1000 members. (1)
class MEMBER
{
int Mcode;char MName[20];
public:

void Register();void Display();
} ;
void main()
{
fstream MFile;
MFile.open(“MEM.DAT”,ios::binary|ios::in);
MEMBER M;
MFile.read((char*)&M, sizeof(M) );
cout<<“Rec:”<<MFile.tellg()/sizeof(M)<<endl;
MFile.read((char*)&M, sizeof(M) );
MFile.read((char*)&M, sizeof(M) );
cout<<“Rec:”<<MFile.tellg()/sizeof(M)<<endl;
MFile.close();
}

SECTION B
(Only for candidates, who opted for Python)

1. (a). Out of the following, find those identifiers, which can not be used for naming Variable or Functions in a Python program: (2)
_Cost, Price*Qty, float, Switch,
Address One, Delete, Numberl2, do

(b). Name the Python Library modules which need to be imported to invoke the following functions (1)
(i) load()
(ii) pow()

(c). Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code. (2)
for Name in [Amar, Shveta, Parag] IF Name[0]=’S’: print(Name)

(d). Find and write the output of the following python code: (2)
Numbers=[9,18,27,36] for Num in Numbers:
for N in range(l, Num%8):
print(N,”#”,end=””) print ()

(e). Find and write the output of the following python code: (3)
class Notes:
def init (self,N=100,Nt=”CBSE”): #constructor
self.Nno=N
self.NName=Nt
def Allocate(self, N,Nt):
self.Nno= self.Bno + N
self.NName= Nt + self.NName
def Show(self):
print(self.Nno,”#”,self.NName)
s=Notes()
t=Notes(200)
u=Notes(300,”Made Easy”)
s.Show()
t.Show()
u.Show()
s. Allocate(4, “Made “)
t.Allocate(10,”Easy “)
u.Allocate(25,”Made Easy”)
s.Show()
t.Show()
u.Show()

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 PICKER. (2)
import random

PICK=random.randint(0,3)
CITY=[“DELHI”,”MUMBAI”,”CHENNAI”,”KOLKATA”];
for I in CITY:
for J in range(1,PICK):
print(I,end=””)
print ()

(i)(ii)
DELHIDELHI
MUMBAIMUMBAI
CHENNAICHENNAI
KOLKATAKOLKATA
DELHI
DELHIMUMBAI
DELHIMUMBAICHENNAI
(iii)(iv)
DELHI
MUMBAI
CHENNAI
KOLKATA
DELHI
MUMBAIMUMBAI
KOLKATAKOLKATAKOLKATA

2. (a). What is the difference between Multilevel and Multiple inheritance? Give suitable examples to illustrate both. (2)

(b). What will be the output of the following python code considering the following set of inputs? (2)
JAYA
My 3 books
PICK2
2120
Also, explain the try and except used in the code.
Counter=O
while True:
try:

Number=int(raw_input(“Give a Number”))
break except
ValueError:
Counter=Counter+2
print(“Re-enter Number”)
print(Counter)

(C). Write a class CITY in Python with following specifications (4)
Instance Attributes
– Code # Numeric value
– Name # String value
– Pop # Numeric value for Population
– KM # Numeric value
– Density # Numeric value for Population Density

Methods:
– CalDen() # Method to calculate Density as Pop/KM
– Record() # Method to allow user to enter values Code,Name,Pop,KM and call CalDen() method
– See() # Method to display all the members also display a message “Highly Populated Area” if the Density is more than 12000.
(d). How do we implement abstract method in python? Give an example for the same. (2)

(e). What is the significance of super() method? Give an example for the same. (2)
3. (a). What will be the status of the following list after the First, Second and Third pass of the insertion sort method used for arranging the following elements in descending order? (3)
22, 24, -64, 34, 80, 43
Note: Show the status of all the elements after each pass very clearly underlining the changes.

(b). For a given list of values in descending order, write a method in python to search for a value with the help of Binary Search method. The method should return position of the value and should return -1 if the value not present in the list. (2)

(c). Write Insert(Place) and Delete(Place) methods in python to add Place and Remove Place considering them to act as Insert and Delete operations of the data structure Queue. (4)

(d). Write a method in python to find and display the prime numbers between 2 to N. Pass N as argument to the method. (3)
(e). Evaluate the following postfix notation of expression. Show status of stack after every operation.
22, 11, /, 14, 10, -, +, 5, –

4. (a). Write a statement in Python to perform the following operations: (1)
• To open a text file “BOOK.TXT” in read mode
• To open a text file “BOOK.TXT” in write mode

(b). Write a method in python to write multiple line of text contents into a text file myfile.txt line. (2)

(c). Consider the following definition of class Staff, write a method in python to search and display the content in a pickled file staff.dat, where Staffcode is matching with ‘S0105’. (3)
class Staff:
def_init_(self,S,SNM) :
self.Staffcode=S
self. Name=SNM
def Show(self):
print(self.Staffcode,” – “,self.Name)

SECTION C
(For all the candidates)

5. (a). Observe the following STUDENTS and EVENTS tables carefully and write the name of the RDBMS operation which will be used to produce the output as shown in LIST? Also, find the Degree and Cardinality of the LIST. (2)
STUDENTS

NoName
1Tara Mani
2Jaya Sarkar
3Tarini Trikha

EVENTS

EVENTCODEEVENTNAME
1001Programming
1002IT Quiz

LIST

NONAMEEVENTCODEEVENTNAME
1Tara Mani1001Programming
1Tara Mani1002IT Quiz
2Jaya Sarkar1001Programming
2Jaya Sarkar1002IT Quiz
3Tarini Trikha1001Programming
3Tarini Trikha1002IT Quiz

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

CODEVTYPEPERKM
101VOLVO BUS160
102AC DELUXE BUS150
103ORDINARY BUS90
105SAV40
104CAR20

Note:
• PERKM is Freight Charges per kilometer
• VTYPE is Vehicle Type Table: TRAVEL
Table: TRAVEL

NONAMETDATEKMCODENOP
101Janish Kin2015-11-1320010132
103Vedika sahai2016-04-2110010345
105Tarun Ram2016-03-2335010242
102John Fen 2016-02-169010240
107Ahmed Khan2015-01-10751042
104Raveena 2016-05-28801054
106Kripal Anya2016-02-0620010125

Note:
• NO is Traveller Number
• KM is Kilometer travelled
• NOP is number of travellers travelled in vehicle
• TDATE is Travel Date

(i). To display NO, NAME, TDATE from the table TRAVEL in descending order of NO.
(ii). To display the NAME of all the travellers from the table TRAVEL who are traveling by vehicle with code 101 or 102.

(iii). To display the NO and NAME of those travellers from the table TRAVEL who travelled between ‘2015-12-31’ and ‘2015-04-01’. Ans. SELECT NO, NAME from TRAVEL

(iv) To display all the details from table TRAVEL for the travellers, who have travelled distance more than 100 KM in ascending order of NOP.
v). SELECT COUNT(*), CODE FROM TRAVEL
GROUP BY CODE HAVING COUNT(*)>l;
(vi). SELECT DISTINCT CODE FROM TRAVEL;

(vii). SELECT A.CODE, NAME, VTYPE
FROM TRAVEL A,VEHICLE B
WHERE A.CODE=B.CODE AND KM<90;
(viii) SELECT NAME,KM*PERKM
FROM TRAVEL A,VEHICLE B
WHERE A.CODE=B.CODE AND A.CODE=’105′;

6. a. Verify the following using Boolean Laws. (2)
A’+ B’.C = A’ .B’.C’+ A’.B .C’+ A’.B .C + A’ .B’.C+ A .B’.C
b. Write the Boolean Expression for the result of the Logic Circuit as shown below: (2)

OR

(U + V’) . (U + W) . (V + W’)
(2 Marks for correctly writing the full expression)

OR
(1 Mark each for correctly writing any one term)

c. Derive a Canonical POS expression for a Boolean function F, represented by the following truth table: (1)

PQRF(P, Q, R)
0000
0011
0101
0110
1000
1010
1101
1111

 

d. Reduce the following Boolean Expression to its simplest form using K-Map: (3)
F(X,Y,Z,W)= (2,6,7,8,9,10,11,13,14,15)


7.(a). Give two examples of PAN and LAN type of networks. (1)

(b). Which protocol helps us to browse through web pages using internet browsers? Name any one internet browser. (1)
(c). Write two advantages of 4G over 3G Mobile Telecommunication Technologies in terms of speed and services? (1)
(d). Write two characteristics of Web 2.0. (1)
(e) What is the basic difference between Trojan Horse and Computer Worm? (1)
(f) Categories the following under Client side and Server Side script category? (1)
(i) VB Sript
(ii) ASP
(iii) JSP
(iv) Java Script
(g). Uplifting Skills Hub India is a knowledge and skill community which has an aim to uplift

the standard of knowledge and skills in the society. It is planning to setup its training centers in multiple towns and villages pan India with its head offices in the nearest cities. They have created a model of their network with a city, a town and 3 villages as follows.
As a network consultant,

you have to suggest the best network related solutions for their issues/problems raised in (i) to (iv), keeping in mind the distances between various locations and other given parameters.

CBSE Question Paper 2016 class 12 Computer Science
Shortest distances between various locations:

VILLAGE 1 to B_TOWN2 KM
VILLAGE 2 to B_TOWN1.0 KM
VILLAGE 3 to B_TOWN1.5 KM
VILLAGE 1 to VILLAGE 23.5 KM
VILLAGE 1 to VILLAGE 34.5 KM
VILLAGE 2 to VILLAGE 32.5 KM
A_CITY Head Office to B_HUB25 Km

Number of Computers installed at various locations are as follows:

B_TOWN120
VILLAGE 115
VILLAGE 210
VILLAGE 315
A_CITY OFFICE6

Note:
• In Villages, there are community centers, in which one room has been given as training center to this organization to install computers.
• The organization has got financial support from the government and top IT companies.

(i). Suggest the most appropriate location of the SERVER in the B_HUB (out of the 4 locations), to get the best and effective connectivity. Justify your answer. (1)

(ii). Suggest the best wired medium and draw the cable layout (location to location) to efficiently connect various locations within the B_HUB. (1)

(iii). Which hardware device will you suggest to connect all the computers within each location of B_HUB? (1)
(iv). Which service/protocol will be most helpful to conduct live interactions of Experts from Head Office and people at all locations of B_HUB? (1)

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 2016

Download class 12 Computer Science question paper with solution from best CBSE App the myCBSEguide. CBSE class 12 Computer Science question paper 2016 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.

myCBSEguide App

Test Generator

Create question paper PDF and online tests with your own name & logo in minutes.

Create Now
myCBSEguide App

myCBSEguide

Question Bank, Mock Tests, Exam Papers, NCERT Solutions, Sample Papers, Notes

Install Now

2 thoughts on “CBSE Question Paper 2016 class 12 Computer Science”

Leave a Comment