You are on page 1of 10

KENDRIYA VIDYALAYA SANGATHAN: BHUBANESWAR REGION

CLASS XII, PRE-BOARD EXAMINATION 2022-23


MAKRING SCHEME
COMPUTER SCIENCES (083)
TIME: 3 HOURS M.M.70
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
Q35 against part (iii) only.
8. All programming questions are to be answered using Python Language and SQL.

Sl. No Chapter Section Section -B Section -C Section -D Section -E Total


-A (2 marks (3 Marks (5 Marks (1+1+2 (70)
(1 mark Question) Question) Question) Mark
MCQ) Question)

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

a) 1 mark for correct answer


Ans.
PRODUCTNAME CITY PRICE
MOBILE MUMBAI 70000
MOBILE MUMBAI 25000

b) ½ mark for correct answer


Write the output of the queries (i) to (iv) based on the table, WORKER
given below:

He has written following queries:


(i) select sum (SALARY) from WORKER where department=’ADMIN’ and
FIRST_NAME like ‘%a’;
Ans.
Sum(SALARY)
170000
(ii) select max (SALARY)*12 as Annual salary from WORKER where
DEPARTMENT= ’ACCOUNT’;
Ans.
Annual salary
2400000
900000

(iii) select min (JOINING_DATE) from WORKER where SALARY>80000;


Ans.
min (JOINING_DATE
2014-02-20

(iv) select DISTINCT DEPARTMENT from worker where SALARY is NOT


NULL order by DEPARTMENT;
Ans.
DISTINCT DEPARTMENT
ACCOUNT
ADMIN
HR
27. 1 mark for correct code function name and definition and 2 marks for correct 3
operation code.
Ans:
def Show_words():
f=open('NOTES.TXT','r')
Lines=f.read()
for l in Lines:
print(l.upper())
f.close()
Show_words()
OR
1 mark for correct code function name and definition and 2 marks for correct
operation code.
Ans:
def Display:
file=open('MYDATA.TXT','r')
lines = file.readlines()
for w in lines:
if w[0]=="K" or w[0]=="k":
print(w)
file.close()
Display()
28. (a) ½ mark for correct answer 3
Write the outputs of the SQL queries (i) to (iv) based on the relations
ACTIVITY and COACH given below:
Table: ACTIVITY
ACODE ANAME STADIUM P_NO P_MONEY DATE
1001 Relay Star Annex 16 10000 23-Jan-2001
1002 High Jump Super Power 12 12000 14-Feb-2003
1003 Shot Put Star Annex 11 8000 07-July-2002
1008 Discuss Throw Star Annex 12 9000 19-Mar-2003
1005 Long Jump Super Power 10 11000 20-Dec-2002

(i) SELECT ANAME, P_MONEY, NAME FROM ACTIVITY, COACH


WHERE ACTIVITY.ACODE=COACH.ACODE AND
P_MONEY>=10000;
Ans.
ANAME P_MONEY NAME
Relay 10000 Ahmed Hussain
Relay 10000 Janila
Short Put 8000 Naaz
Discuss Throw 9000 Rvinder

(ii) SELECT ANAME, P_NO, NAME FROM ACTIVITY, COACH


WHERE ACTIVITY.ACODE=COACH.ACODE ORDER BY P_NO
DESC;
Ans.
ANAME P_NO NAME
Relay 16 Ahmed Hussain
Relay 16 Janila
Discuss Throw 12 Rvinder
Short Put 11 Naaz

(iii) SELECT COUNT (*), STADIUM FROM ACTIVITY GROUP BY


STADIUM;
Ans.:
COUNT(*) STADIUM
3 Star Annex
2 Super Power

(iv) SELECT MAX(P_MONEY), MIN(P_MAONY) FROM ACTIVITY


WHERE STADIUM LIKE ‘S%’;
Ans.:
MAX(P_MONEY) MIN(P_MONEY)
10000 8000
12000 11000

(b) 1 mark for correct answer


Write a SQL Command to show details about Table structure.
Ans:
mysql>> DESC <Table Name>; or DESCRIBE <Table Name>;
29. 1 mark for correct code function name and definition and 2 marks for correct 3
operation code.
Ans:
def DIVIDEBY(LS):
KS=[]
for i in LS:
if i%3==0 or i%7==0:
KS.append(i)
print(KS)
30. 1mark for correct PUSH_NO () function definition and 1 mark for correct testing 3
condition.
1 mark for correct POP_DISPLAY () function definition.
Ans:
i.
def PUSH_NO (ST, N):
for k in N:
if k%2==0:
ST.append(k)

ii.
def POP_NO(ST):
print("TOP", end="->",)
while True:
if ST!=[]:
print(ST.pop(), end=" ")
else:
break

# Function Call / main part of the program


N=[12,13,34,18,45,98,22,79,35,38]
ST=[]
PUSH_NO(ST,N)
POP_NO(ST)

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

# Function Call / main part of the program


Races ={100:'Varnika',200:'Jugal',400:'Kushal',800:'Minisha'}
Stk=[]
PUSH_DATA(Stk, Races)
POP_DATA(Stk)
SECTION D
31. CBSE Public School, Bangalore is Setting up the network between its Different
Wings of school campus. There are 4 wings named as SENIOR(S), JUNIOR(J),
ADMIN(A) and HOSTEL(H). As a network consultant, you have to suggest the
best network related solutions for them for issues/problems raised in question
nos. (i) to (v), keeping in mind the distances between various blocks/locations
and other given parameters.
Distance between various wings are Wings Number of Computers
given below: Wing A 75
WingA to WingS 100 m Wing H 25
WingA to WingJ 20 m Wing J 50
WingA to WingH 150 m Wing S 65
WingS to WingJ 300 m
WingS to WingH 100 m
WingJ to WingH 450 m
i. Suggest the best-wired medium to connect various wings of CBSE Public
School, Bangalore.
Ans: Ethernet / Twisted Pair Cable
1
ii. Suggest the best cable layout to efficiently connect various wings of CBSE
Public School, Bangalore. 1
Ans:
1

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

a) 1 mark for advantage of CSV file


b) ½ mark for importing csv module
1 ½ marks each for correct definition of Write_Data() and Display()
½ mark for function call statements
i) import csv
def Write_Data():
f=open("Student.csv","w", newline='')
rec=[]
x=int(input("No. of data to be entered:"))
w=csv.writer(f)
w.writerow(['Roll no','Sname','Class',’Percentage’])
for i in range(x):
rno=int(input("Enter Roll No:"))
name=input("Enter Student name:")
cls=int(input("Enter Class:"))
per=float(input(“Enter Percentage”))
rec=[rno,name,cls,per]
w.writerow(rec)
f.close()
Write_Data()

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:

***********************************************

You might also like