Kendriya Vidyalaya Sangathan Kolkata Region Pre-Board Examination 2020-21 Class - Xii Subject:Computer Science Time: 3Hrs M.M.-70
Kendriya Vidyalaya Sangathan Kolkata Region Pre-Board Examination 2020-21 Class - Xii Subject:Computer Science Time: 3Hrs M.M.-70
Kendriya Vidyalaya Sangathan Kolkata Region Pre-Board Examination 2020-21 Class - Xii Subject:Computer Science Time: 3Hrs M.M.-70
CLASS –XII
SUBJECT:COMPUTER SCIENCE
TIME: 3HRS
M.M.-70
General Instructions:
1. This question paper contains two parts A and B. Each part iscompulsory.
2. Both Part A and Part B have choices.
3. Part-A has 2sections:
a. Section – I is short answer questions, to be answered in one word or oneline.
b. Section – II has two case studies questions. Each case study has 4 case-based sub-
parts. An examinee is to attempt any 4 out of the 5subparts.
4. Part - B is DescriptivePaper.
5. Part- B has threesections
a. Section-I is short answer questions of 2 marks each in which two question have
internaloptions.
b. Section-II is long answer questions of 3 marks each in which two questions have internal
options.
c. Section-III is very long answer questions of 5 marks each in which one question has
internaloption.
6. All programming questions are to be answered using Python Languageonly
Page 1 of 8
c) D[[2,3]]=5
d) print(len(D))
6 Write a statement in Python to declare a list of tuples L with values 1
(1,Monday), (2,Tuesday) and (3,Wednesday) respectively.
7 A tuple is declaredas 1
T=(8,2,3,(9,8))What will be the value of T.count(8)?
8 Name the built-in function / method to convert the string ‘Hello’ to 1
[‘h’,’e’,’l’,’l,’,o’].
9 Name the chat protocol where must have registered user IDs. 1
10 What is Firewall? 1
15 Name the transmission media best suited for high speed data communication. 1
20 Which of the following types of table constraints will prevent the entry of 1
duplicate rows?
a) Unique
b) Distinct
c) PrimaryKey
d) NULL
21 Rearrange the following terms in increasing order of data transfer rates. 1
2Gbps, 2024 Mbps, 200 MBps, 40 Kbps
Section-II
Both the Case study based questions are compulsory. Attempt any 4 sub
parts from each question. Each question carries 1 mark
22 A table CLIENT stores the details of all clients for a store. As a database
administer, Amit has decided that:
• Name of the database -STORE
Page 2 of 8
• Name of the table -CLIENT
• The attributes of CLIENT are as follows:
C_ID - numeric
ClientName – character of size 20
City - character
P_ID – alphanumeric of size 5
Table Client
(c) Insert the following data into the attributes C_ID, ClientName and City 1
respectively in the given table CLIENT.
C_ID = 20, ClientName = “Manoj Kumar” and City = Mumbai
(d) Amit want to remove the table CLIENT from the database STORE. 1
Which command will he use from thefollowing:
a) DELETE FROMCLIENT;
b) DROP TABLECLIENT;
c) DROP DATABASESTORE;
d) DELETE CLIENT FROMSTORE;
(e) Now Amit wants to display the structure of the table CLIENT, i.e, name of 1
the attributes and their respective data types that he has used in the
table. Write the query to display the same.
23 Ranjan Kumar of class 12 is writing a program to create a CSV file “user.csv”
which will contain user name and password for some entries. He has written the
following code. As a programmer, help him to successfully execute the given
task.
import # Line 1
Page 3 of 8
f.close()
addCsvFile(“Arjun”,”123@456”)
addCsvFile(“Arunima”,”aru@nima”)
addCsvFile(“Frieda”,”myname@FRD”)
readCsvFile() #Line5
(a) Name the module he should import in Line 1. 1
(b) In which mode, Ranjan should open the file to add data into the file 1
(c) Fill in the blank in Line 3 to read the data from a csv file. 1
Part -B
SECTION - I
Page 4 of 8
28 Rewrite the following code in Python after removing all syntax error(s). 2
Underline each correction done in the code.
for i in range(2,10)
for j in ragne(3,i)
if 2<i<5:
print(i)
elif 3<=5:
print(J)
29 Observe the following program and answer the questions that 2
follow:
import random
city= [ "DEL", "CHN", "KOL", "BOM", "BNG"]
for I in range(1,4):
Fly = random.randrange (0,2) + 1 ;
print( city[Fly] ,end=":")
(a) What is the minimum and maximum number of times the loop will
execute?
(b) Find out, which line of output(s) out of (i) to (iv) will not be expected
from the program?
#Output Options:
i. DEL: CHN : KOL : ii. CHN : KOL : CHN :
iii. KOL : BOM : BNG : iv. KOL : CHN : KOL :
30 What do you understand by Foreign Key in a table? Give a suitable 2
example of foreign keys from a table containing some meaningful data.
31 Give an example of fetchall() method to fetch and display a table. 2
def Display(str):
m=""
for i in range(1,len(str)):
if(str[i].isupper()):
m=m+str[i-1].lower()
elif str[i].islower():
m=m+str[i+1].upper()
else:
if i%2==0:
Page 5 of 8
m=m+str[i-1]
else:
m=m+"#"
print(m)
Display('Fun@Python3.0')
Section- II
34 Write a function Listsum(L) that accepts a List L and finds the summation of all 3
the even elements in it and returns the summation.
35 Write a function findlines() in Python that prints those lines which start with 3
T or t in a text file “STORY.TXT”.
If the “STORY.TXT” contents are as follows:
This is the content
of the
text file story.txt.
Now print those lines
that start
with T
Output:
This is the content
text file story.txt.
that start
OR
Write a function findfreq() that will find the frequency of each word in the text file
FREQ.TXT and display it on screen. (Note upper case and lowercase words should
not be counted separately).
For e.g if input is :
This is a python program
Python programming is fun
Output :
this occour(s) 1 time(s)
is occour(s) 2 time(s)
a occour(s) 1 time(s)
python occour(s) 2 time(s)
program occour(s) 1 time(s)
programming occour(s) 1 time(s)
fun occour(s) 1 time(s)
36 Write the outputs of the SQL queries (i) to (iii) based on the relations 3
STAFF and PAYMATRIX given below:
SCODE NAME DESIG PLEVEL DOJ DOB
11 ABD CLERK 2 12-Sep-04 23-Aug-81
12 DCG HR 3 22-Jan-10 12-Jul-67
14 EKJ CLERK 2 14-Jun-09 14-Nov-82
16 DEL HR 1 21-Aug-06 12-Mar-84
18 SEDC ADMIN 2 19-Dec-05 09-Jul-89
PAYMATRIX
Page 6 of 8
3 34000 12050
1 12000 8500
1) Select desig,count(*) from staff group by desig;
2) Select max(doj),min(dob) from staff group by plevel;
3) Select Name,pay+allowance as totalpay from staff natural join
paymatrix;
37 Write a function in Python PUSH(Arr), where Arr is a list of numbers. From this 3
list push all numbers divisible by 5 into a stack implemented by using a list.
Display the stack if it has at least one element, otherwise display appropriate
error message.
OR
Write a function in Python POP(Arr), where Arr is a stack implemented by a
list of numbers. The function returns the value deleted from the stack.
Section-III
Computers in each wing are networked but wings are not networked. The
company has now decided to connect the wings also.
i. Suggest a most suitable cable layout for the above connections.
ii. Suggest the most appropriate topology of the connection between the wings.
iii. The company wants internet accessibility in all the wings. Suggest a suitable
technology.
iv. Suggest the placement of the following devices with justification if the company
wants minimized network traffic. a)Repeater b)Hub / switch
v. The company is planning to link its head office situated in New Delhi with the
offices in hilly areas. Suggest a way to connect it economically.
Page 7 of 8
39 Study the following table(s) 5
COURIER
CNO CName Amount CDate CCode
159 Vicky 250 01-Jan-2018 2
245 Sam 220 11-Feb-2019 1
358 Alex 315 30-Apr-2018 3
468 Louis 160 01-Mar-2018 2
576 Terry 190 01-Aug-2019 4
688 Lima 200 03-Nov-2019 4
790 Rosy 200 21-Jul-2019 2
894 Luke 325 17-May-2018 1
940 Elizabeth 150 15-Jan-2019 3
999 Nicolas 100 10-Jul-2019 3
DESTINATION
Dcode City
1 Paris
2 London
3 Delhi
4 New York
1. Display cname, cdate and amount of all the couriers in decreasing order or amount.
2. Display cno, amount from the table courier having cdate between 01-apr-2018 and
01-jun-2018
3. Display cname and their corresponding destination city.
4. Display the total amount of orders for each city code.
5. Increase the amount by 10% for ccode=4
40. 5
A binary file “Stu.dat” has structure [Sno, S_Name, Roll, Cls].
i. Write a user defined function CreateFile() to input data for a
record and add to Stu.dat.
ii. Write a function CountStu(Cls) in Python which accepts the Class
name as parameter and count and return the no of students in that
classfrom the binary file “Stu.dat”.
OR
A CSV file “BOOK.CSV” has structure (Bno,BName, Author,price). Write a function
showbooks() in Python that would read contents of the file “BOOK.CSV” and display
the details of those books whose price is above 275.
Page 8 of 8