CS - XII - PB - II -SET-A
CS - XII - PB - II -SET-A
CLASS-XII (2024-25)
Subject: Computer Science
Max. Time: 3 Hours Max. Marks: 70
Date : 13.12.2024 Set -A
_____________________________________________________________________________________________________________
General Instructions :
This question paper contains five sections, Section A to E.
All questions are compulsory.
Section A has 18 questions carrying 1 mark each.
Section B has 7 Very Short Answer (VSA) type questions carrying 2 marks each.
Section C has 5 Short Answer (SA) type questions carrying 3 marks each.
Section D has 3 Long Answer (LA) type question carrying 5 marks each.
Section E has 2 questions carrying 4 marks each. One internal choice is given in
Q 35 against part C only.
All programming questions are to be answered using Python Language only.
SECTION A
6. Which of the following modes in Python creates a new file, if file does not
exist and overwrites the content, if the file exists ?
a) r+ (b) r (c) w (d) a
16. fetchone() method fetches only one row in a ResultSet and returns a _____
a) Tuple b) List c) Dictionary d) String
Q. 17 and 18 are Assertion (A) and Reasoning (R) based questions. Mark
the correct choice as
(a) Both (A) and (R) are true and (R) is the correct explanation for (A).
(b) Both (A) and (R) are true and (R) is not the correct explanation for (A).
(c) (A) is true but (R) is false.
SECTION B
20. (a) Write any two differences between Fiber-optic cable and Coaxial cable.
2
OR
(b) Write one advantage and one disadvantage of wired over wireless
communication. 2
21. (a) Given is a Python string declaration : 1
NAME = "Learning Python is Fun"
Write the output of : print(NAME[-5:-10:-1])
SECTION C
Table : Sport
ADMNO GAME
1100 CRICKET
1103 FOOTBALL
27. (a) Write a function in Python that displays the book names having
y in their name from a text file Bookname.t 3
Example :
s the names of following books :
28. Write the output of any three SQL queries (i) to (iv) based on the tables COMPANY
and CUSTOMER given below : 3
Table : COMPANY
CID C_NAME CITY PRODUCTNAME
111 SONY DELHI TV
222 NOKIA MUMBAI MOBILE
333 ONIDA DELHI TV
444 SONY MUMBAI MOBILE
555 BLACKBERRY CHENNAI MOBILE
666 DELL DELHI LAPTOP
Table : CUSTOMER
CUSTID CID NAME PRICE QTY
C01 222 ROHIT SHARMA 70000 20
C02 666 DEEPIKA KUMARI 50000 10
C03 111 MOHAN KUMAR 30000 5
C04 555 RADHA MOHAN 30000 11
For example :
If the lists of courses details are :
3]
2]
3]
2]
3]
SECTION D
31. ABC Consultants are setting up a secure network for their office campus
at Noida for their day-to-day office and web-based activities. They are
planning to have connectivity between three buildings and the head office
situated in Bengaluru. As a network consultant, give solutions to the
questions (i) to (v), after going through the building locations and other
details which are given below :
Distance between various blocks/locations :
BUILDING 3
Building Distance
Building 1 to Building 3 120 m
Building 1 to Building 2 50 m
Building 2 to Building 3 65 m
Noida Branch to Head Office 1500 km
Number of computers
32. (a) (i) What possible output(s) are expected to be displayed on screen
at the time of execution of the following code ? 2
import random
S=["Pen","Pencil","Eraser","Bag","Book"]
for i in range (1,2):
f=random.randint(i,3)
s=random.randint(i+1,4)
print(S[f],S[s],sep=":")
OR
(b) (i) Predict the output of the code given below : 2
text="LearningCS"
L=len(text)
ntext=" "
for i in range (0,L):
if text[i].islower():
ntext=ntext+text[i].upper()
elif text [i].isalnum():
ntext=ntext+text[i 1]
else:
ntext=ntext+'&&'
print(ntext)
Statement 3 to read the complete result of the query into the object named
B_Details, from the table Bookshop in the database.
Table : Salesperson
S_ID S_NAME AGE S_AMOUNT REGION
S001 SHYAM 35 20000 NORTH
S002 RISHABH 30 25000 EAST
S003 SUNIL 29 21000 NORTH
S004 RAHIL 39 22000 WEST
S005 AMIT 40 23000 EAST
import # Statement 1
def Copy_new():
f1= # Statement 2
f2= # Statement 3
item_id=int(input("Enter the item id"))
item_detail= # Statement 4
pickle. # Statement 6
f1.close()
f2.close()
He has succeeded in writing partial code and has missed out certain
statements. Therefore, as a Python expert, help him to complete the code
based on the given requirements :
"items.dat". (Statement 2) 1