Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Kendriya Vidyalaya Sangathan Kolkata Region Pre-Board Examination 2020-21 Class - Xii Subject:Computer Science Time: 3Hrs M.M.-70

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

KENDRIYA VIDYALAYA SANGATHAN KOLKATA REGION

PRE-BOARD EXAMINATION 2020-21

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

Question Part-A Marks


No. allocated
Section-I
Select the most appropriate option out of the options given for each
question. Attempt any 15 questions from question no 1 to 21.
1 Find the invalid identifier from the following 1
a) for1 b)ifelse c)2day d)_ab12
2 Given the lists L=[1,23,[4,5,6],3,12,-2] , write the output of print(L[-1:-6:-2]) 1
3 What will be the result of x=2**3**2 1
4 Identify the valid operators in Python from the following. 1
a) >= b)& c)** d)++
5 Suppose a dictionary D is declared as D = {10:12, 43:39, 11:19}, which of the 1
following is incorrect?
a)print(D[1])
b) D[11] =-29

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

11 ________ clause is used in conjunction with SELECT statement to eliminate 1


duplicate values in a column.
12 What is the use of having clause with group by? 1
13 Give the name of one single row function in SQL. 1

14 Which of the following is not a DML command? 1


a) INSERT b)DROP c)UPDATE d)DELETE

15 Name the transmission media best suited for high speed data communication. 1

16 Identify the valid declaration of L: 1


L = [(3,4),(2,’False’), (‘12’,45), (’60.5’,21)]
a. List of Lists b.List of tuples c.tuple of lists d.tuple of Tuples
17 If the following code is executed, what will be the output of the following code? 1
s='This is CS examination'
print(s.split())
18 Which command is used to select a database DB from a list of existing databases 1

19 What is the full form of SMTP? 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_ID ClientName City P_ID


23 Amanjit Shaw Delhi P2
26 Bhavna Singh Lucknow P4
21 Mahesh Rai Mumbai P12
33 Raunak Das Delhi P32
42 Amit Patra Kolkata P19
(a) Identify the attribute best suitable to be declared as a primary key, 1

(b) Write the degree and cardinality of the table CLIENT. 1

(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

defaddCsvFile(UserName,PassWord): # to write / add data intothe


CSVfile
f=open('user.csv',' ') # Line2
newFileWriter = csv.writer(f)
newFileWriter.writerow([UserName,PassWord])

Page 3 of 8
f.close()

#csv file reading code


defreadCsvFile(): # to read data from CSVfile with
open(' user.csv','r') asnewFile:
newFileReader=csv. (newFile) # Line 3 for
row innewFileReader:
print (row[0],row[1])
newFile. # Line4

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

(d) Fill in the blank in Line 4 to close the file. 1

(e) Write the output he will obtain while executing Line 5. 1

Part -B

SECTION - I

24 Evaluate the following expressions: 2


a) 24 and False or 32 and ‘’
b) [2,’abc’,45]>[2,’abd’,62]
25 Differentiate between Viruses and Worms in context of networking and data 2
communication threats.
OR
Differentiate between Static and Dynamic webpage. Write any two popular web
browsers.
26 Expand the following terms: 2
a. HTTP b. POP3 c.GPRS d. VoIP

27 Differentiate between actual parameter(s) and a formal parameter(s) with a 2


suitable example for each.
OR
Explain the use of global key word used in a function with the help of a suitable
example.

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

32 Classify the following as DDL or DML commands. 2


Update, ALTER, INSERT,DROP
33 Find and write the output of the following Python code: 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

PLEVEL PAY ALLOWANCE


2 20300 10000

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

38 A company ABC has 4 wings as shown. 5

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

You might also like