CS Class XII Paper
CS Class XII Paper
CS Class XII Paper
General Instructions:
i. This question paper contains five parts Part A, B, C, D and E. Each part is compulsory.
ii. Section A has 18 questions carrying 01 mark each.
iii. Section B has 07 Very Short Answer type questions carrying 02 marks each.
iv. Section C has 05 Short Answer type questions carrying 03 marks each.
v. Section D has 02 Case-based questions carrying 04 marks each.
vi. Section E has 03 Long Answer type questions carrying 05 marks each.
vii. All programming questions are to be answered using Python Language only.
PART- A
1. Find the valid identifier from the following
[1]
(A). 2_Myname (B). My name (C). True (D). Myname_2
2. Which of the following operator can be used with string data type?
[1]
(A) ** (B) % (C) + (D) /
3. Identify the output of the following Python statements.
x = [[10.0, 11.0, 12.0],[13.0, 14.0, 15.0]] [1]
y = x[1][2] print(y)
4. What will be the output of the following Python code?
i= 1
while True:
if i%0O7 == 0: [1]
break
print(i)
i += 1
5. The variable declared outside all the functions is called a. .. …………variable. [1]
6. Identify the output of the following Python statements.
L= [10, 15, 20, 25, 30]
L.insert( 3, 4) [1]
L.insert( 2, 3)
print (lst1[-5])
7. The... ….. of a variable is the area of the program where it may be referenced. [1]
8. "One device per connection" is an advantage of:
[1]
(A) Star topology (B) Tree topology (C) Bus topology (D) Ring topology
9. The…. function creates a file object used to call other support methods associated with it. [1]
10. ……….. means organization of data. [1]
11. Which protocol is used for the transfer of hypertext content over the web? [1]
(A) HTML (B) HTTP (C) TCP/IP (D) FTP
12. …………is a freely-available open-source RDBMS that implements SQL. [1]
13. ………… method of pickle module is used to write an object into binary file. [1]
14. What is the output of the following code?
def fun (n) :
if (n > 100): [1]
return n - 5
return fun (fun (n+11))
print (fun (45))
15. Tricking people through authentic-looking emails or websites is called………… [1]
16. Which clause is used in query to place the condition on groups in MySQL?
[1]
(A) WHERE (B) HAVING (C) GROUP BY (D) Both (A) & (B)
17. In a Stack, if a user tries to remove an element from an empty Stack, the situation is called:
[1]
(A) Underflow (B) Overflow (C) Empty collection (D) Garbage collection
18. …………is known as range operator in MySQL.
[1]
(A) DISTINCT (B) IN (C) IS (D) BETWEEN
PART- B
19. Write the short note on protocol. Also writes the name of two protocols. [2]
OR
Explain following terms-
(A). Circuit Switching
(B). Trojan Horse
20. What is a function? How is it useful? [2]
OR
Predict the output of the Python code given below:
def Diff(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
21. Write a query that counts the number of sales people registering orders for each day from the table [2]
‘orders’ with their ‘id’. (If a salesperson has more than one order on a given day, he or she should be
counted only once.)
22. Ravi has written a code to input a number and check whether it is prime or not. His code is having errors. [2]
Rewrite the correct code and underline the corrections made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
23. How is a hacker different from a cracker? [2]
OR
Explain following terms-
(A). Topology
(B). Ethernet Card
24. Write the output of the code given below: [2]
d={}
my_dict = {"name": "Suman", "age": 34}
d=my_dict
my_dict['age'] = 32
my_dict['address'] = "Delhi"
print(d.items())
25. Differentiate between count() and count(*) functions in SQL with appropriate example. [2]
OR
Name SQL Single Row functions (for each of the following) that-
1. returns total no. of letters of the given text
2. returns text into lowercase letters
3. returns names of days, For example : ‘‘Monday’’, ‘‘Tuesday’’
4. returns month number from the given date
PART- C
26. Write a function in Python, Push(SItem) where , SItem is a dictionary containing the details of stationary [3]
items– {Sname:price}.
The function should push the names of those items in the stack who have price greater than 75. Also
display the count of elements pushed into the stack.
For example: If the dictionary contains the following data:
Ditem={"Pen":106,"Pencil":59,"Notebook":80,"Eraser":25}
The stack should contain
Notebook
Pen
The output should be:
The count of elements in the stack is 2
27. ABC Organization has set up its new center at Delhi for its office and
web based activities. It has 4 blocks of buildings as shown in the diagram:
PART- D
31. Rohill, a student of class 12, is learning CSV File Module in Python. During examination, he has been
assigned an incomplete python code (shown below) to create a CSV File Student.cav (content shown
below). Help him in completing the code which creates the desired CSV File.
Incomplete Code CSV File-
1. AKSHAY, XII, A
import csv 2. ABHISHEK, XII, A
fh= open(___,___,newline=") #Statement-1 3. ARVIND, XII, A
4. RAVI, XII, A
stuwriter = csv.______ #Statement-2 5. ASHISH XII, A
data = [ ]
header = [‘ROLL_NO’, ‘NAME’, ‘CLASS’, ‘SECTION’]
data.append(header)
for in range(5):
roll_no= int(input("Enter Roll Number:"))
name= input("Enter Name:")
Class = input("Enter Class :")
section= input("Enter Section: "")
rec = [ ______ ] #Statement-3
data.append(rec)
stuwriter. _______ (data) #Statement-4
fh.close( )
i. Write the missing code for blank space in line marked as Statement-1. [1]
ii. What is the function name (with argument) that should be used in the blank space of line marked as
[1]
Statement-2?
iii. Identify the suitable code for blank space in line marked as Statement-3. [1]
iv. Identify the suitable code for blank space in the line marked as Statement-4. [1]
32. A Stationary Store is considering to maintain their inventory using SQL to store the data. As a database
administer, Rajan has decided that:
• Name of the database – STATIONARY_STORE
• Name of the table - INVENTORY
• The attributes of INVENTORY are as follows:
ItemNo - numeric Table : INVENTORY
ItemName - character of size 20
ItemNo ItemName Scode Quantity
Scode - numeric
Quantity – numeric 2005 Notebook Classic 23 60