Professional Documents
Culture Documents
1 Computational 11 3 3 2 1 40
Thinking and
Programming -2
2 Computer 1 2 0 1 0 10
Networking
3 Database 6 2 2 0 1 20
Management
Marks 18 14 15 15 08 70
Q. No. SECTION A Marks
1. False 1
2. (a)try 1
3. (b) Tup[2] = 90 1
4. (c) 5 2 3* 1
5. (c) [[27, 56, 30]] 1
6. (c) ab 1
7. (c) tuple 1
8. (c) UPDATE 1
9. (d) Both Line 3 and Line 4 1
10. (c) Primary & Unique 1
11. (a) f = open(‘sum_list’,’wb’); pickle.dump(l1,f) 1
12. (c) WHERE 1
13. (b) SMTP 1
14. (c) False 1
15. (b) AGV(salary) 1
16. (d) execute() 1
17. (b) Both A and R are true and R is not the correct explanation of A. 1
18. (a) Both A and R are true and R is the correct explanation of A. 1
SECTION B
19. ½ mark for each finding error and correct in code. 2
Ans:
def func(a):
for i in range(0,a):
if i%2 ==0:
s=s+1
elif i%5= =0:
m=m+2
else:
n=n+i
print(s,m,n)
func(15)
20. 2 marks for correct two points of difference between Star topology and Bus 2
topology.
OR
2 marks for correct two points of difference between Website and Webpage.
21. 1 mark each correct output 2
Ans:
a. 'rttsuM'
b. 6
22. 1 marks for correct use of primary key and 1 marks for suitable example 2
23. (a) 1/2 mark for each correct fullform 2
(i) XML: eXtensible Markup Language
(ii) URL : Uniform Resource Locator
(b) 1 mark for correct definition of MAC:
24. 2 marks for correct output 2
Ans:
Output: kVSbbrObbbHUBANEWSAR
OR
Output:
c is: Life
('Hello', 'World', 'Good')
25. 2 marks for correct answer 2
OR
1 mark for correct difference between DELETE and DROP command and 1
mark for correct example.
SECTION C
26. 3
ii.
def POP_NO(ST):
print("TOP", end="->",)
while True:
if ST!=[]:
print(ST.pop(), end=" ")
else:
break
OR
1mark for correct PUSH_DATA () function definition and 1 mark for correct
testing condition.
1 mark for correct POP_SHOW () function definition.
Code
Ans:
i.
def PUSH_DATA(Stk,Races):
for i in Races:
if i>100:
Stk.append(Races[i])
ii.
def POP_DATA(Stk):
print("TOP")
while True:
if Stk!=[]:
print(Stk.pop())
else:
break
iii. Suggest name of the most suitable wing where the Server should be
installed. Justify your answer.
Ans: ADMIN(A) Block because A block have maximum number of
Computer Systems.
iv. Suggest a device/software and its placement that would provide data
security for the entire network of the School.
Ans: Firewall at ADMIN (A) Block
v. Suggest a device and the protocol that shall be needed to provide wireless
Internet access to all smartphone /laptop users in the campus of CBSE
Public School, Bangalore.
Ans: WiFi-MODEM cum Router, HTTPS or TCP/IP
32. a) 2 mark for correct Output 2+3
Ans: Output:
150 # 50
150 $ 100
160 # 150
b) 1 mark for each correct statement
Statement 1 – import mysql.connector as pymysql
Statement 2 – dbcon=pymysql.connect(host=”localhost”, user=”root”,
passwd =“root”, database= “test”)
Statement 3 - mycur=dbcon.cursor()
OR
a) 2 mark for correct Output
Ans: Output
53 @ 20
53 # 33
46 @ 33
53 $ 46
b) 1 mark for each correct statement
Statement 1 – mycursor=con1.cursor()
Statement 2 – res=mycusor.execute(query)
Statement 3- data= mycursor.fetchall()
33. a) 1 mark for correct difference between CSV and Text file. 5
b) 1 ½ marks for each correct code of ADD( ) and COUNTR() function definition
and ½ mark for function call statements.
Ans:
i. import csv
def ADD():
f=open("record.csv","w", newline='')
rec=[]
x=int(input("No. of data to be entered:"))
w=csv.writer(f)
w.writerow(['Item ID','Item name','Quantity'])
for i in range(x):
ids=input("Enter item ID:")
name=input("Enter item name:")
qty=int(input("Enter Quantity:"))
rec=[ids,name,qty]
w.writerow(rec)
f.close()
ADD()
ii)
def COUNTR():
flag=-1
f=open("record.csv","r")
r1=csv.reader(f)
for i in r1:
flag=flag+1
print("total no. of records=",flag)
f.close()
COUNTR()
OR
ii)
def Display():
f=open("record.csv","r")
r1=csv.reader(f)
for i in r1:
print(i)
f.close()
Display()
SECTION E
34. Mr. Ravi creates a table RESULT with a set of records to maintain the marks 1+1+2
secured by students in MT_1, MT_2, MT_3 and MT_4 . After creation of the
table, he has entered data of 4 students in the table.
Table: RESULT
RollNo Sname Class MT_1 MT_2 MT_3 MT_4
1201 JOHN 12 423 325 417 365
1002 ANURAG 10 323 413 407 265
1211 NIKUNJ 12 235 362 342 298
1014 SOHAM 10 456 413 407 465
Based on the data given above answer the following questions:
(i) Identify the most appropriate column, which can be considered as Primary
key.
Ans: RollNo
(ii) If two columns are added and 2 rows are deleted from the table RESULT,
what will be the new degree and cardinality of the above table?
Ans: degree: 7+2=9 and cardinality : 2
(iii) Write the statements to:
a. Remove student data from the table whose Roll No is 1014.
Ans: DELETE FROM RESULT WHER ROLLNO=1014;
b. To display percentage of MT_2 marks (out of 500) of each student.
Ans: SELECT ROLLNO, MT_2*100/500 “ Percentage ” FROM
RESULT;
OR
Write the statements to:
a. Delete MT_4 column from RESULT table.
Ans: ALTER TABLE RESULT DROP COLUMN MT_4;
b. Add a column REMARKS in the table with datatype as varchar with 50
characters.
Ans: ALTER TABLE RESULT ADD COLUMN REMARKS
VARCHAR(50);
35. A Binary file “Exam.Dat” is already present in the system that stores few records each 1+1+2
containing name of the student along with the registration number. A function
Vowel() is defined below to retrieve the records and display only those records in
which the names start with a vowel.
There are some places in the code left blank to be marked with (____) . As a Python
expert to complete the following code based on the requirement given:
import ____________ # Statement 1
def Vowel():
f=open(___________________) # Statement 2
print(“Records of the existing file are:”)
try:
while True:
rec=_______________(f) # Statement 3
for a in rec:
name=a[0]
if (name[0]==’A’ or name[0]==’E’ or name[0]==’I’ or name[0]==’O’ or
name[0]==’U’ ):
print(a[0],’\t’,a[1])
___________________ Statement 4
break
f.close()
(i) Which module should be imported in the program? (Statement 1)
Ans: import pickle
(ii) Write the correct statement required to open a file. (Statement 2)
Ans: f=open(“Exam.dat”, “rb+”)
(iii) Which statement should fill in Statement 3 to read the data from the binary file,
Exam.dat and in Statement 4 to error handle with try statement?
Ans: rec=pickle.load(f) and except EOFError: Or except:
***********************************************