PCBCS Pre-Board Answer Key
PCBCS Pre-Board Answer Key
MARKING SCHEME
12
Maximum M
TIME : 3hrs DATE : Marks: 70
General Instructions:
SECTION-A
1. False 1
2. (A) eval 1
3. (D) dict_student.update(dict_marks) 1
4. (B) False 1
5. () mail2@gtsangathan. 1
6. (D) close() 1
7 (C) alter 1
8 (B) DROP DATABASE 1
9 (C) S4 1
10 (C) Foreign Key 1
11 (D) file_object.seek(offset *, reference_point+) 1
12 (A) DISTINCT 1
13 (B) VoIP 1
14 (C) 18 1
15 (D) count(*) 1
16 (B) connect 1
17 (B)Gateway 1
18 Packet Switching 1
19 (b)FTP 1
20. (A) Both A and R are true and R is the correct explanation for A 1
21. (C) A is True but R is False 1
SECTION B
25. a)L1.count(3) 2
or
b)L1.sort()
a)L1.extend(l2)
or
b)L2.reverse()
26. Correct definition with example -each carries 1 mark 2
Advantage: The network remains operational even if one of the nodes stops working.
Disadvantage: The network stops working if the central hub stops working.
Or any other valid advantage or disadvantage. Each carries 1 mark
29. SECTION C 3
def displaywords():
f = open('data.txt','r') s =
f.read()
lst = s.split() for
x in lst:
if len(x)>3:
print(x, end=" ")
f.close()
OR
def countvowels():
f - open('info.txt', 'r') s =
f.read()
count = 0 for
x in s:
if x in 'AEIOU':
count+=1
print(count)
f.close()
Correct definition of function will fetch 3 marks. For each syntax error ½ mark may be
deducted.
30. xiia=*+ 3
student=**'Rajveer', '99999999999','XI', 'B'+,*'Swatantra', '8888888888','XII', 'A'+,
*'Sajal','77777777777','VIII','A'+,*'Yash', '1010101010','XII','A'++
def pushElement(student):
for d in student:
if d*2+=='XII' and d*3+=='A':
xiia.append(*d*0+,d*1++)
def popElement():
while len(xiia)!=0:
print(xiia.pop())
else:
print('Stack Empty')
pushElement(student)
print(xiia)
popElement()
(1.5 marks for correct pushElement() and 1.5 marks for correct popElement())
OR
stackItem=*+
def Push(SItem): count=0
for k in SItem:
if (SItem*k+>=25):
stackItem.append(k)
count=count+1
print("The count of elements in the stack is : ", count)
½ mark for the Select with avg(), ½ mark for the having clause
½ mark for the Select with count() , ½ mark for group by clause
1 mark for the Select with sum()
def COUNTR():
fin=open("teacher.csv","r",newline="\n")
data=csv.reader(fin)
d=list(data)
print(“No of records :”,len(d))
fin.close()
ADD()
COUNTR()
½ mark for importing and
½ mark for opening the file
(A) CODING 2
NETWORKING 1
ANALYSIS 1
TESTING 1
RUPALI 3000
Development HR
LOGISTICS ADMIN
fobj=open("Book.dat","rb")
num = 0
try:
while True:
rec=pickle.load(fobj)
if Author==rec[2]:
num = num + 1
print(num)
except:
fobj.close()
or
import pickle
def CountRec():
fobj=open("STUDENT.DAT","rb")
num = 0
try:
while True:
rec=pickle.load(fobj)
print(rec*0+,rec*1+,rec*2+,sep="\t")
num = num + 1
print(num)
except:
fobj.close()