KENDRIYA VIDYALAYA SANGATHAN, RAIPUR REGION
FIRST PREBOARD EXAM, SESSION: 2020-21
Class: XII
Subject: Computer Science (083)
Maximum Marks:70 Time Allowed: 3hours
___________________________________________________________________________________
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
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 one line.
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 5 subparts.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which two question have
internal options.
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
internal option.
6. All programming questions are to be answered using Python Language only
Q.NO Section-I Marks
Select the most appropriate option out of the options given for each question. Attempt any 15 Allotted
questions from question no 1 to 21.
1 Which of the following is valid relational operator in Python: ? 1
(i)// (ii)? (iii)< (iv)and
2 Given the lists L=[1,3,6,82,5,7,11,92] , write the output of print(L[2:5]) 1
3 Which module is used for working with CSV files in Python? 1
4 Identify the valid declaration of L: 1
L = [1, 23, ‘hi’, 6]
(i)list (ii)dictionary (iii)array (iv)tuple
5 Suppose list L is declared as L = [0.5 * i for i in range (0,4)], list L is 1
a) [0,1,2,3]
b) [0,1,2,3,4]
c) [0.0,0.5,1.0,1.5]
d) [0.0,0.5,1.0,1.5,2.0]
6 Write a statement in Python to declare a dictionary whose keys are ‘Jan’, ’Feb’, ’Mar’ and values 1
are 31, 28 and 31 respectively.
7 A list is declared as 1
L=[(2,5,6,9,8)]
What will be the value of print(L[0])?
8 A function definition in python begins with which keyword? 1
9 Name the protocol that is used for the transfer of hypertext content over the web. 1
10 In a Multi-National company Mr. A steals Mr. B’s intellectual work and representing it as A’s own 1
work without citing the source of information, which kind of act this activity be termed as?
11 In SQL, name of the keyword used to display unique values of an attribute. 1
12 In SQL, what is the use of ORDER BY clause ? 1
1|Page
13 Write the function used in SQL to display current date. 1
14 Which of the following is a DML command? 1
a) CREATE b)ALTER c) INSERT d) DROP
15 Give at least two names for Guided and Unguided Transmission Media in networking. 1
16 What will be the output when the following code is executed 1
>>> str1 = “helloworld”
>>> str1[ : -1]
a. 'dlrowolleh' b.‘hello’ c.‘world’ d.'helloworl'
17 If the following code is executed, what will be the output of the following code? 1
name="Kendriya Vidyalaya Class 12"
print(name[9:15])
18 In SQL, write the command / query to display the structure of table ‘emp’ stored in a database. 1
19 Write the expanded form of Wi-Fi and GSM. 1
20 Which of the following type of column constraints will allow the entry of unique and 1
not null values in the column?
a) Unique
b) Distinct
c) Primary Key
d) NULL
21 Rearrange the following terms in increasing order of data transfer rates. 1
Gbps, Mbps, Tbps, Kbps, bps
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 Medical store “Lifeline” is planning to maintain their inventory using SQL to store the
data. A database administer has decided that:
Name of the database -medstore
Name of the table –MEDICINE
The column of MEDICINE table are as follows:
ino - integer
iname – character of size 15
mcode - integer
qty – integer
ino iname mcode qty
1001 Surgical Mask 22 60
1002 Sanitizer 22 50
1003 Paracetamol 21 150
1005 Fast Relief gel 23 250
1006 Dettol 22 220
2004 Cough syrup 24 110
2009 Hand gloves 22 180
2|Page
(a) Identify the attribute best suitable to be declared as a primary key, 1
(b) If Administrator adds two more attributes in the table MEDICINE then what will be the degree 1
and cardinality of the table MEDICINE.
(c) Administrator wants to update the content of the row whose ino is 1003 as , iname = 1
“Paracetamol Tablet ” mcode = 25 and qty = 100
(d) Administrator wants to remove the table MEDICINE from the database medstore . 1
Which command will he use from the following:
a) DELETE FROM store;
b) DROP TABLE MEDICINE;
c) DROP DATABASE medstore;
d) DELETE MEDICINE FROM medstore;
(e) Now Administrator wants to display only unique code of the table MEDICINE . Write the query 1
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
def addCsvFile(UserName,PassWord): # to write / add data into the CSV file
f=open('user.csv',' ') # Line2
newFileWriter = csv.writer(f)
newFileWriter.writerow([UserName,PassWord])
f.close()
#csv file reading code
def readCsvFile(): # to read data from CSV file
with open(' user.csv','r') as newFile:
newFileReader = csv. (newFile) # Line 3
for row in newFileReader:
print (row[0], row[1])
newFile. # Line4
addCsvFile(“Arjun”,”123@45)
addCsvFile(“Arunima”,”aru@ma”)
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
3|Page
Part B
Section-I
24 Evaluate the following expressions: 2
a) 6 * 3 + 4**2 // 5 – 8
b) 10 > 5 and 7 > 12 or not 18 > 3
25 Differentiate between Virus and Trojan Horse in context of networking and data 2
communication threats.
OR
Differentiate between Web hosting and web browser. Write any two popular
web browsers.
26 Expand the following terms: 2
a. SMTP b. XML c. MAN d. FTP
27 Differentiate between actual parameter(s) and a formal parameter(s) with a suitable 2
example for each.
OR
Write the difference between Global Variable and Local Variable
28 Rewrite the following code in Python after removing all syntax error(s). Underline 2
each correction done in the code.
DEF execmain():
x = int( input("Enter a number:"))
if (abs(x) = x):
print"You entered a positive number"
else:
x=*-1
print("Number made positive :",x)
execmain()
29 What possible outputs(s) are expected to be displayed on screen at the time of 2
execution of the program from the following code?
import random
X= random.random()
Y= random.randint(0,4)
print(int(),":",Y+int(X))
(i) 0:5 (ii) 0:3 (iii) 0:0 (iv) 2:5
30 Define Candidate Key and Alternate Key with suitable examples from a table containing 2
some meaningful data.
31 Differentiate between fetchone() and fetchall() methods with suitable 2
examples for each.
32 Write the full forms of TCL and DDL. Write any two commands of DDL in SQL. 2
4|Page
33 Find and write the output of the following Python code: 2
def mainu():
Moves=[11, 22, 33, 44]
Queen=Moves
Moves[2]+=22
L=len(Moves)
for i in range (L):
print("Now@", Queen[L-i-1], "#", Moves [i])
mainu()
Section- II
34 Write a function copylist(lst1,lst2) in Python, which accepts two list Lst1 and Lst2 of 3
numbers and copies the common numbers into third list.
Sample Input Data of the list
lst1 = [ 10,20,30,40,12,11]
lst2 = [ 10,30,40,13,15,76]
Output
[10,30,40]
35 Write a method/function ISTOUPCOUNT() in python to read contents from a text file 3
WRITER.TXT, to count and display the occurrence of the word ‘‘IS’’ or ‘‘TO’’ or ‘‘UP’’.
For example : If the content of the file is-
IT IS UP TO US TO TAKE CARE OF OUR SURROUNDING. IT IS NOT POSSIBLE
ONLY FOR THE GOVERNMENT TO TAKE RESPONSIBILITY
The method/function should display Count of IS TO and UP is 6
OR
Write a function AMCount() in Python, which should read each character of a text
file STORY.TXT, should count and display the occurrence of alphabets A and M
(including small cases a and m too).
Example:
If the file content is as follows:
Updated information
As simplified by official websites.
The AMCount() function should display the output as:
A or a:4
5|Page
Table Name : Stationery
M or m :2
S_ID StationeryName Company Price StockDate
DP0136 Write the outputs of ABC
Dot Pen the SQL queries
10 (i) to 2011-03-31
(iii) based on the relations Stationery and 3
Consumer given below:
PL02 Pencil XYZ 6 2010-01-01
ER05 Eraser XYZ 7 2010-02-14
PL01 Pencil CAM 5 2009-01-09
GP02 Gel Pen ABC 15 2009-03-19
Table Name: Consumer
C_ID ConsumerName Address P_ID
01 Good Learner Delhi PL01
06 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Write & Draw Delhi PL02
16 Motivation Bengaluru PL01
i. SELECT count(DISTINCT Address ) FROM Consumer;
ii. SELECT Max(StockDate),Min(StockDate) FROMStationery;
iii. SELECT Stationery.StationeryName,Stationery.Company,
Consumer.ConsumerName, Consumer.Address FROM Stationery, Consumer
WHERE Stationery.S_ID = Consumer.P_ID AND Consumer.Address =”Delhi”;
37 Write a function in Python PushBook(Book) to add a new book entry as book_no 3
and book_title in the list of Books , considering it to act as push operations of the
Stack data structure.
OR
Write a function in Python PopBook(Book), where Book is a stack implemented by a list of
books. The function returns the value deleted from the stack.
6|Page
Section- III
38 Riana Medicos Centre has set up its new centre in Dubai. It has four buildings as shown in 5
the diagram given below:
Accounts
Lab
Unit
Building No. of
Accounts to Research Lab 55 m
Computer
Accounts to Store 150 m
Accounts 25
Store to Packaging Unit 160 m
Research Lab 100
Packaging Unit to Research Lab 60 m
Store 15
Accounts to Packaging Unit 125 m
Packaging Unit 60
Store to Research Lab 180 m
As a network expert, provide the best possible answer for the following queries:
i. Suggest the type of network established between the buildings.
ii. Suggest the most suitable place (i.e., building) to house the server of this
organization.
iii. Suggest the placement of the Repeater in the network with justification.
iv. Which device will you suggest to be placed/installed in each of these blocks
/centers to efficiently connect all the computers within these blocks/centers.
v. Suggest a system (hardware/software) to prevent unauthorized access to or
from the network.
39 Write SQL commands for the following queries (i) to (v) based on the relations Vehicle and 5
Travel given below.
Table :Travel
NO NAME TDATE KM CODE NOP
101 Janish Kin 2015-11-13 200 101 32
103 Vedika Sahai 2016-04-21 100 103 45
105 Tarun Ram 2016-03-23 350 102 42
102 John Fen 2016-02-13 90 102 40
107 Ahmed Khan 2015-01-10 75 104 2
104 Raveena 2016-05-28 80 105 4
7|Page
Table : Vehicle
CODE VTYPE PERKM
101 VOLVO BUS 160
102 AC DELUXE BUS 150
103 ORDINARY BUS 90
105 SUV 40
104 CAR 20
i. To display NO, NAME, TDATE from the table Travel in descending order of
NO.
ii. To display the NAME of all the travelers from the table Travel who are travelling
by vehicle with code 101 or 102.
iii. To display the NO and NAME of those travelers from the table Travel who
travelled between ‘2015-12-31’ and ‘2016-04-01’.
iv. To display the CODE,NAME,VTYPE from both the tables with distance travelled
(km) less than 90 Km.
v. To display the NAME of those traveler whose name starts with the alphabet ‘R’.
40 A binary file “student.dat” has structure [rollno, name, marks]. 5
i. Write a user defined function insertRec() to input data for a student
and add to student.dat.
ii. Write a function searchRollNo( r ) in Python which accepts the student’s
rollno as parameter and searches the record in the file “student.dat” and
shows the details of student i.e. rollno, name and marks (if found)
otherwise shows the message as ‘No record found’.
OR
Write a function filter(oldfile, newfile) that copies all the lines of a text file “source.txt”
onto “target.txt” except those lines which starts with “@” sign.
8|Page