Pre-Board Examination - II Computer Science PB-2-2022-23-12 - (B) Time: 3 Hrs. M. Marks: 70
Pre-Board Examination - II Computer Science PB-2-2022-23-12 - (B) Time: 3 Hrs. M. Marks: 70
Pre-Board Examination - II
COMPUTER SCIENCE
PB-2-2022-23-12-(B)
General Instructions :
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 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 Q34 against part c only.
8. All programming questions are to be answered using Python Language only.
SECTION - A
1. Which line of code will not produce an error? (1)
(A) “Pre” * ‘2’ (B) 2 * “Pre”
(C) “Pre’* 2 (D) “Pre” * “2”
2. Given a function that does not return any value________ data item is returned by default in
Python (1)
(A) int (B) float
(C) bool (D) None
a. fp.seek(offset, 0) b. fp.seek(offset, 1)
c. fp.seek(offset, 2) d. none of the mentioned
12. The SQL clause used to restrict non empty values in a field is __________ (1)
a. UNIQUE b. NOT NULL
c. DISTINCT d. IS NULL
13. HTTP stands for . (1)
a. Hyper Text Transfer Protocol b. Hyper Text Technology Protocol
c. Hyper Transfer Text Protocol d. Hyper Tech Textual Protocol
14. What will be the following expression evaluated to in Python? (1)
60*2 - (7 // 2) ** 2 ** 2
a. 39 b. 244
c. 141 d. 32
15. In MySQL, __________ keyword can be used to to put conditions on each tuple of a table (1)
a. WHERE b. HAVING
c. ORDER BY d. GROUP BY
16. Object created by ______ method is used to execute fetchone( ) (1)
a. cursor( ) b. execute( )
c. connection( ) c. connector( )
COMPUTER SCIENCE-(B)- 1 / 3
17. Assertion (A) (1)
In the following question a statement of Assertion (A) is followed by a statement of Reason (R).
Mark the correct choice as:
Assertion (A): Type Conversion is used to convert one datatype to another. It has two types.
Reasoning (R): Dynamic Typing is one of the typeconverions given by the user.
(a) Both Assertion (A) and reason (R) are true and reason (R) is the correct explanation of
Assertion (A).
(b) Assertion (A) and reason (R) are true and reason (R) is not the correct explanation of
Assertion (A).
(c) Assertion (A) is true but reason (R) is false.
(d) Assertion(A) is false but reason (R) is true.
18. In the following question a statement of Assertion (A) is followed by a statement of Reason (R).
Mark the correct choice as:
Assertion (A): Binary is a file format for data storage which looks like a text file.
Reasoning (R): The information present in a binary fileis organized in the form of UNICODE
characters and file can be manipulated by any text editor.
(a) Both Assertion (A) and reason (R) are true and reason (R) is the correct explanation of
Assertion (A).
(b) Assertion (A) and reason (R) are true and reason (R) is not the correct explanation of
Assertion (A).
(c) Assertion (A) is true but reason (R) is false.
(d) Assertion(A) is false and reason (R) is false.
SECTION - B
19. Rewrite the corrected code after removing the errors from the following code. Also underline the
corrections made: (2)
D1 = {[1,2,3]:”A”, 2:”B”, 3:”C”}
def F1():
print(D1[4])
D1.append({4:”D”})
print(D1*4)
return
print(F1())
20. What is meant by topology. Explain any one with one advantage and one disadvantage. (2)
OR
What do you mean by transmission media. Explain any three guided transmission medias.
21. Predict the output of the given code : (2)
(i) >>>print( "PREBoard2" > "PREboard2")
(ii) >>> str1 = "Pre Board2-DPS VK"
>>> str1. partition("2")
COMPUTER SCIENCE-(B)- 1 / 4
a) Write a method Search( ) to read a text file "lib.txt" and display all lines having “horror” word
in it.
OR
b) Write a method Count( ) to read a text file "lib.txt" and count the lines in which there are more
than three words.
28. a) Consider the following tables TOURIST and PLACE. Write outputs for SQL queries (i) to
(iv). (2)
Table : Booking
Aid Place Bamt Bdate
P2 Paris 200000 2020-05-10
P3 Andaman 150000 2021-12-25
P1 Singapore 300000 2022-11-10
P3 Phuket 200000 2018-10-09
P2 Paris 250000 2019-10-10
P1 Bangkok 400000 2020-07-12
P2 Phuket 150000 2022-11-12
P1 Canada 200000 2018-08-03
Table : Agency
Aid Agency Pincode
P1 Maketrip 110070
P2 Travelgo 110033
P3 Kings 110009
BLOCK B 15
BLOCK C 50
BLOCK D 20
Distance between various blocks:
Block A to Block B - 50 m
Block B to Block C - 115 m
Block C to Block D - 1.5 km
Block A to Block D - 270 m
Block B to Block D - 225 m
Block A to Block C - 1 km
Based on the above information, answer the following questions.
i Name the block where the server is to be installed. Justify your answer.
ii Suggest suitable topology and draw the cable layout to connect all blocks in Chennai.
iii Name the blocks where a switch should be installed.
iv What is the network type formed (out of LAN, MAN, WAN) between Block A To C.
v Suggest a protocol that shall be required to send email.
COMPUTER SCIENCE-(B)- 1 / 8
32. Attempt any one from I or II. Each Question has (a) and (b) parts
I(a) Write the output: (2)
def F1(x,y = 5):
global a
a += x+2
x -= 20//y-2
y += a // 2
print(a, x, y,sep="@")
return x
a=3
b,c = a**2, a*2
b = F1(b)
c = F1(b,c)
print(a,b,c,sep='@')
(b) The given code is written using MYSQL and Python connectivity which displays number of
articles based on qoh entered by the user from a table Grocery [ino, iname, category, qoh,
unitprice]. Write the missing statements to perform the given task- (3)
import mysql.connector
mydb = mysql.connector.connect (host = “localhost”, user =”root”, passwd=”student”)
mycur = mydb.cursor()
Qoh1 = input(“Enter Quantity on hand to be searched -”)
Q1 =”SELECT * FROM GROCERY WHERE QOH=”+Qoh1+” ”
_________________ # Statement 1 to execute the statement
rec = ____________ #Statement 2 to Retrieve the records
C = _____________ #Statement 3 to count the rows retrieved
if C == 0:
print(“No such record”)
else:
print(“Articles with QOH”, C)
OR
II
a) Write the output :