12 Computer SP 11
12 Computer SP 11
Maximum Marks : 70
Time Duration : 3Hr
Subject : Computer
Science
B
General Instructions:
1. This question paper contains five sections, from Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
8. All programming questions are to be answered using Python Language only.
Section A
1. State true or false:
The max() and min() when used with tuples, can work if elements of the tuple are all of the same types.
a) True
b) False
2. Which of the following join gives the intersection of two tables?
a) Inner join
b) Outer join
c) Equi join
d) None of these
3. Which command is used to display the name of existing databases?
a) show databases;
b) display databases;
c) result databases;
d) output databases;
4. What is the area of memory called, which stores the parameters and local variables of a function call?
a) an array
b) storage area
c) a stack
d) a heap
5. Signals generated by an operating system to send it over phone line must be further converted into a/an
a) analog signal
b) microwave
c) AC signal
d) digital signal
6. To open a file c:\res.txt for reading, we can use (select all correct options):
a. file = open("c: \res.txt", "r")
b. file = open("c:\ \res.txt", "r")
c. file = open(r"c: \res.txt", "r")
d. file = open(file = "c:\res.txt", "r")
e. file = open(file = "c:\ \res.txt", "r")
f. file = open("c:\ \res.txt")
1 / 15
a) d, e, f
b) a, e, f
c) b, d, f
d) b, c, f
7. What does the special file called data dictionary contains?
a) The data types of all data in all files.
b) The names of all fields in all files.
c) All of these
d) The widths of all fields in all files.
8. Which SQL function is used to count the number of rows in a SQL query?
a) COUNT(*)
b) NUMBER( )
c) COUNT( )
d) SUM( )
9. A can get input from live interaction through keyboard/GUI or it may take input as command line arguments
or from the files.
a) Code
b) Program
c) Class
d) Method
10. Which of the following functions removes all leading and trailing spaces from a string?
a) rstrip()
b) lstrip()
c) strip()
d) all of these
11. What is the conventional name of pointer associated with the stack?
a) FIRST
b) TOP
c) REAR
d) FRONT
12. Which shortcut key is used to pause the function?
a) Alt + Break
b) Insert + Break
c) Ctrl + Break
d) Shift + Break
13. Which of the following is a client-side scripting language?
a) Perl
b) PHP
c) VB Script
d) Ruby
14. Which of the following is a relational operator?
a) <<
b) <
c) =
d) /=
15. Find ODD parity bit for 10010110
a) 0
b) 1
c) none of these
2 / 15
d) 2
16. Two devices are in network if
a) a process is running on both devices
b) a process in one device is able to exchange information with a process in another device
c) PIDs of the processes running of different devices are of same type
d) none of these
17. Assertion (A): The list can contain data of different types.
Reason (R): We can use slice [:] operator to access the data of the list.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
18. Assertion (A): It is good practice to close the file once all the operations are done.
Reason (R): We can perform any operation on the file externally using the file system which is currently opened in
Python.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
Section B
19. What measures do wireless networks employ to avoid collisions?
20. What is the output of the following?
i=4
while True:
if i% 0o7 == 0:
break
print(i, end = ' ')
i += 1
OR
Predict the output of following code fragment:
fruit = { }
f1 = ['Apple', 'Banana', 'apple', 'Banana']
for index in f1:
if index in fruit:
fruit [index] += 1
else:
fruit[index] =1
print(fruit)
print (len(fruit))
21. Write Python code to increase age of all employees by 1 year in the Employee table of database HTMdb with
userid HRMan and password HRMANexe@pwd.
22. Answer:
i. What will the following query do?
import mysql.connector
db = mysql.connector.connect(.. )
cursor = db.cursor( )
db.execute("SELECT * FROM staff WHERE person_id in {}".format((1,3,4)))
db.commit( )
db.close( )
3 / 15
ii. What does connection.commit( ) method do?
Table: COACH
Consider the following tables CARDEN and CUSTOMER and answer (b) and (c) parts of this question:
Table: CARDEN
Table: CUSTOMER
Section E
34. Read the text carefully and answer the questions:
The Freshminds University of India is starting its first campus in Ana Nagar of South India with its center admission
office in Kolkata. The university has 3 major blocks comprising of Office Block, Science Block and Commerce Block in
the 5 km area Campus.
As a network expert, you need to suggest the network plan as per (i) to (iv) to the authorities keeping in mind the
6 / 15
distance and other given parameters.
Expected Wire distances between various locations:
Office Block to Science Block 90 m
Office Block to Commerce Block 80 m
Science Block to Commerce Block 15 m
Kolkata Admission office to Ana Nagar Campus 2450 km
Expected number of Computers to be installed at various locations in the University are as follows:
Office Block 10
Science Block 140
Commerce Block 30
Kolkata Admission office 8
i. What type of server should be installed in university?
i. Dedicated
ii. Non-dedicated
ii. Suggest the most suitable place (i.e., block) to house the server of this university with a suitable reason.
iii. Suggest the most suitable (very high speed) service to provide data connectivity between Admission
Office located in Kolkata and the campus located in Ana Nagar from the following options:
i. Telephone line
ii. Fixed-Line Dial-up connection
iii. Co-axial Cable Network
iv. GSM
v. Leased line
vi. Satellite Connection
OR
Suggest an efficient device to be installed in each of the blocks to connect all the computers.
35. Read the text carefully and answer the questions:
Consider the following tables GAMES and PLAYER:
Table: GAMES
Table: PLAYER
7 / 15
i. To display the content of the GAMES table in ascending order of Schedule Date.
ii. To display sum of PrizeMoney for each type of GAMES.
8 / 15
Class 12 - Computer Science
Sample Paper - 11 (2022-23)
Solution
Section A
1. (a) True
Explanation: True
2. (a) Inner join
Explanation: Inner join
3. (a) show databases;
Explanation: show databases;
4. (c) a stack
Explanation: Stack stores the parameters and local variables of a function call.
5. (a) analog signal
Explanation: An analog signal is any continuous signal for which the time-varying feature of the signal is a
representation of some other time-varying quantity, i.e., analogous to another time-varying signal. Analog signals
produce too much noise. Examples:- Human voice, Thermometer, Analog phones, etc.
6. (d) b, c, f
Explanation:
In file path, '\r' is a carriage return character, to normalise it we use another / before it or use 'r' prefix before the
file path.
We do not need to mention the file keyword to input the file path in open function.
To practice more questions & prepare well for exams, download myCBSEguide App. It provides complete study
material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams. Teachers can use Examin8 App to create
similar papers with their own name and logo.
7. (c) All of these
Explanation: The data dictionary is structured in tables and views just like other database data.
8. (a) COUNT(*)
Explanation: COUNT(*) takes null value row in to consideration.
9. (b) Program
Explanation: Program
10. (c) strip()
Explanation: strip()
11. (b) TOP
Explanation: TOP is the pointer associated with the stack.
12. (c) Ctrl + Break
Explanation: Ctrl + Break
13. (c) VB Script
Explanation: VB Script and Java Script are examples of client-side scripting languages. Rest all are server-side scripting
languages.
14. (b) <
Explanation: <
15. (b) 1
Explanation: Parity refers to the number of bits set to 1 in the data item
Even parity - an even number of bits are 1
9 / 15
myCBSEgu
ide
Odd parity - an odd number of bits are 1
A parity bit is an extra bit transmitted with a data item, chose to give the resulting bits even or odd parity
Odd parity - data: 10010110, the parity bit 1
16. (b) a process in one device is able to exchange information with a process in another device
Explanation: Two devices are in network if a process in one device is able to exchange information with a process in
another device.
17. (b) Both A and R are true but R is not the correct explanation of A.
Explanation: Python Lists can contain data of different types. The items stored in the list are separated with a comma (,)
and enclosed within square brackets []. List slicing returns a new list from the existing list.
18. (a) Both A and R are true and R is the correct explanation of A.
Explanation: We can perform any operation on the file externally using the file system which is currently opened in
Python; hence it is good practice to close the file in python program once all the desired operations are carried out in the
file.
Section B
19. The wireless networks employ a protocol called CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
to avoid collisions in the network.
It is a multiple access method in which the carrier is sensed first and a node attempts to avoid collisions by transmitting
only when it senses that the carrier is idle i.e., no other node is transmitting data.
Wireless networks use CSMA/CA as they cannot detect collisions; hence they avoid it.
20. 4 5 6 (Note. 0o7 is a valid integer, written in octal forming)
OR
{'Apple' : 1}
{'Apple' : 1, 'Banana' : 1}
{'Apple' : 1, 'Banana' : 1, ’apple’ : 1}
{'Apple' : 1, 'Banana' : 2, 'apple' : 1}
3
21. import MySQLdb
db = MySQLdb.connect('localhost', 'HRMan', 'HRMANexe@pwd', 'HTMdb')
cursor = db.cursor()
sql = """UPDATE Employee set Age=
Age+1 try:
db.execute(sql)
db.commit()
except:
db.rollback()
db.close()
22. Answer:
i. It will extract rows from staff table where person_id is 1 or 3 or 4.
ii. This method sends a COMMIT statement to the MySQL server, committing the current transaction. Since by
default Connector/Python does not auto-commit, it is important to call this method after every transaction that
modifies data for tables.
23. The program will print nothing as before reaching the print statement in the function, the program control encounters the
return statement.
24. The problem with the above code is inconsistent indentation. In Python, we cannot indent a statement unless it is inside a
suite and we can indent only as much as required.
OR
Advantage of pop() method over a del keyword is that it provides the mechanism to print desired value if tried to remove
a non-existing dictionary pair.
Syntax
dictionary_name.pop(key, 'Text')
OR
def displayMeMy():
num = 0
f = open("story.txt",
"rt") N = f.read()
M = N.split()
for x in M:
if x == "Me" or x == "My":
print(x)
num = num+1
f.close()
print("Count of Me/My in file:", num)
Section C
26. Answer:
i. for i in range(3,5)
if(i==4):
print("Welcome")
else:
print("No entry")
print("value of i",i)
ii. P
R
O
G
OR
When we use GROUP BY clause (for grouping of data) and ORDER BY clause (for sorting data) together, the ORDER
BY clause always follows other clauses. That is, the GROUP BY clause will come before the ORDER BY clause. For
example In this query,
SELECT user_id, SUM(score) AS total_score FROM user_score GROUP BY user_id ORDER BY user_id ASC;
28. def OddSum(NUMBERS) :
odd_sum = 0
for num in range (len(NUMBERS)):
if (NUMBERS[num] % 2 != 0:
odd_sum = odd_sum + NUMBERS [num]
print odd_sum
29. import pickle
def CountRec():
fobj = open("STUDENT.DAT",
"rb") num = 0
try:
while True:
rec = pickle.load(fobj)
if rec[2] > 75:
print(rec[0], rec[1], rec[2], sep= "\t")
num = num + 1
except:
fobj.close()
return num
30. import random
def randomNDigitNumber(n):
num = " "
firstlteration = True
for i in range(n):
randomDigit = " "
if firstlteration:
randomDigit = str(random.randint(1, 9))
firstlteration = False
else:
randomDigit = str(random.randint(0, 9))
num = randomDigit + num
return num
print(randomNDigitNumber(7))
i. The default parameters are parameters with a default value set to them. This default value is automatically considered
as the passed value WHEN no value is provided for that parameter in the function call statement.
Thus default arguments are useful when we want to skip an argument in a function call statement and use the default
value for it instead.
ii. The keyword arguments give complete control and flexibility over the values sent as arguments for the
corresponding parameters. Irrespective of the placement and order of arguments, keyword arguments are correctly
matched. A keyword argument is where you provide a name to the variable as you pass it into the function.
Section D
31. Book = [ ]
def Addnew (Books, Name):
Book.append(Name)
print("Book", "Name", "inserted")
def Remove (Books) :
if Books == [ ] :
print ("stack is empty")
else :
print ("Book ",Books.pop(), "deleted")
OR
a. Primary Key of CARDEN = Ccode CARDEN Alternate Key = CarName: Primary key of Customer = Code
Alternate Key of Customer = Cname 2
b. i. SELECT CarName FROM CARDEN WHERE Color = "SILVER";
ii. SELECT CarName, Make, Capacity FROM CARDEN ORDER BY Capacity DESC;
iii. SELECT MAX(Charges) FROM CARDEN;
iv. SELECT Cname, CarName From CUSTOMER CARDEN, WHERE CUSTOMER. Ccode = CARDEN. Ccode;
c. i. 4
OR
SWITCH
35. i. Primary Key is a unique and non-null key, which is used to identify a tuple uniquely. If a table has more
than one such attributes which identify a tuple uniquely than all such attributes are known as candidate keys.
ii. i. SELECT GameName, GCode FROM GAMES;
ii. SELECT * FROM Games WHERE PrizeMoney > 7000;
iii. i. SELECT * FROM Games ORDER BY ScheduleDate;
ii. SELECT SUM(Prizemoney) FROM Games GROUP BY Type;