Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

20-21/CS/B

KENDRIYA VIDYALAYA SANGATHAN, JAIPUR REGION


FIRST PRE-BOARD EXAMINATION 2020-21
Class- XII Computer Science (083)
Maximum Marks: 70 Time Allowed: 3 hours
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 2 sections:
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
subparts. 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
PART-A
Section-I
Select the most appropriate option out of the options given for each question.
Attempt any 15 questions from question no1 to 21
1. Find the valid identifier from the following 1
(a) Tot$balance (b) TRUE (c) 4thdata (d) break
2. Given a string S = “ComPUterSciEnce”, write the output of 1
print(S[3:10:2])
3. ……………………….. is the module used for storing data in binary format. It can be used 1
to store any kind of object in file and allows to store python objects with their
structure..
4. Identify the valid relational operator in Python from the following. 1
(a) ? (b) => (c) != (d) in
5. Suppose a tuple T is declared as T=(10,20,30) and a list L=["mon", "tue", "wed", 1
"thu", "fri", "sat", "sun"], which of the following is incorrect ?
a) min(L)
b) L[2] = 40
c) T[3] = “thurs”

1
d) print( min(T))
6. Write a statement in Python to declare a dictionary MONTH whose keys are 1
1,2,3,4,5,6 and values are January, February, March, April, May, June respectively.
7. A tuple is declared as T = (“JAY”, “HARSH”, “SEEMA”, “PRAKASH”) 1
what will be the value of max(T)
8. Name the built-in mathematical function/method that is used to return the square 1
root of a number.
9. Name the protocol that is used for remote login. 1
10. Mr. Bose has complaint that somebody has taken my credit card details and used it 1
without my knowledge. He claimed to be a Bank official and Mr. Bose has shared
some confidential details with him due to which he had lost all his credit card
balance. Identify the type of cybercrime for these situations.
11. In SQL, name the Operator that is used to search a value similar to specific pattern 1
in a column using wildcard operators like % and _.
12. Riya has given the following SQL command to display Name of employees whose 1
Employee code is not available.
SELECT NAME FROM EMP WHERE EMPCODE=NULL;
Identify the error in above command and re write the command.
13. Write aggregate command in SQL to calculate average of tuples in an attribute of a 1
table.
14. Which of the following is a DML command ? 1
(a) DROP (b) INSERT (c) ALTER (d) CREATE
15. Name the transmission media best suitable for transmission in a large area i.e 1
across the countries.
16. Identify the valid declaration of T: 1
T = {“Roll”:123, “Name”: “Hiya”, “Class”:12, “Subject” : ”Computer Science”}
a. dictionary b. string c. tuple d. list

17. If the following code is executed, what will be the output of the following code ? 1
Lt=[1,”Computer”,2,”Science”,10,”PRE”,30,”BOARD”]
print(Lt[3:])
18. In SQL, write the query to display the list of all databases. 1
19. Write the expanded form of WiMAX. 1
20. Which among the following are valid table constraints? 1
a) Candidate Key
b) NULL
c) Distinct
d) Primary Key
21. Rearrange the following terms in increasing order of Bandwidth. 1
KHz, Hz, GHz, THz, MHz
Section-II
Both the case study based questions are compulsory. Attempt any 4 subparts
from each question. Each question carries 1 mark.
22. A Book store is considering to maintain their inventory using SQL to store the data.
As a database administer, shashank has decided that:

2
 Name of database – BOOK STORE
 Name of table – BOOK
 The attribute of BOOK are as follows:
Code – alphanumeric of size 10
Bname – character of size 30
Cust_code – float
Price – numeric
Type – character of size 25

Table : BOOK
Code Bname Cust_code Price Type
F101 The priest C083 315 Fiction
L102 German easy C312 410 Literature
C103 Tarzan in the lost C113 100 Comic
world
F102 Untold story C083 215 Fiction
C102 War heroes C113 150 Comic
F103 Poison Garden C083 200 Fiction
(a) Identify the attribute best suitable to be declared as a primary key. 1
(b) Write the degree and cardinality of Table BOOK. 1
(c) Insert the following data into the attributes Code, BName, Cust_code and Price. 1
Code = ‘C105’ Bname = “City heroes” Cust_code= ‘C113’ and Price=75
(d) Rahul want to remove all the records from the table BOOK. Which command will 1
he use from the following:
(a) DROP TABLE BOOK;
(b) DELETE FROM BOOK;
(c) DROP DATABASE BOOK STORE;
(d) DELETE BOOKS FROM BOOK;
(e) Now Rahul wants to display the structure of the table BOOK, i.e, name of the 1
attributes and their respective data types that he has used in the table. Write the
query to display the same.
23 Parth Patel of class 12 is writing a program to create a CSV file “emp.csv” which will
contain employee code and name of some employees. He has written the following
code. As a programmer, help him to successfully execute the given task.

import #Line 1
def addemp(empcode,name):#to write/add data into the CSV file
fo=open('emp.csv','a')
writer=csv. (fo) #Line 2
writer.writerow([empcode,name])
fo.close()

#csv file reading code


def reademp():

3
with open('emp.csv',' ') as fin: #Line 3
filereader=csv.reader(fin)
for row in filereader:
for data in row:
print(data,end='\t')
print(end='\n')
fin. #Line 4

addemp('E105','Parth')
addemp("E101",'Arunima')
addemp("E102",'Prahalad')
reademp() #Line 5
(a) Name the module he should import in Line 1. 1
(b) Fill in the blank in Line 2 to write the data in a CSV file. 1
(c) In which mode, Parth should open the file to read the data from the file(Line 3). 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. Give the output given by the following code fragments. 2
a) y=str(123)
print(y*3)
b) 5 <10 and 10 < 5 or 3 < 18 and not 8 < 18
25. Differentiate between Spam and Trojan horse in context of networking and data 2
communication threats.
OR
Differentiate between URL and Domain name. Explain with help of a suitable
example.
26 Expand the following terms: 2
a. FTP b. HTML c. PAN d. GPRS
27. Write the output given by following Python code. 2
x=1
def fun1():
x=3
x=x+1
print(x)

def fun2():
global x
x=x+2
print(x)

fun1()
fun2()
OR

4
What do you mean by default parameters? Explain with the help of suitable
example.
28. Rewrite the following code in Python after removing all syntax error(s). Underline 2
each correction done in the code.
STRING=""WELCOME
NOTE = " "
for S in range(0,8):
if STRING[S]= ’E’:
print(STRING(S))
Else:
print “NO”

29. What are the possible outcome(s) executed from the following code ? Also specify 2
the maximum and minimum values that can be assigned to variable N.
import random
SIDES=["EAST","WEST","NORTH","SOUTH"]
N=random.randint(1,3)
OUT=""
for I in range(N,1,–1):
OUT=OUT+SIDES[I]
print(OUT)
(i) SOUTHNORTH
(ii) SOUTHNORTHWEST
(iii) SOUTH
(iv) EASTWESTNORTH
30 What do you understand by Primary key and Candidate keys in a table ? Explain 2
with the help of suitable example from a table containing some meaningful data.
31. #To fetch all records of a table at run time 2
import .connector #Line 1
mydb=mysql.connector. (host="localhost",user="root",
passwd="root", database="school") #Line 2
mycursor=mydb.cursor()
mycursor. ("select * from student") # Line 3
myrecords=mycursor. () # Line 4
for x in myrecords:
print (x)
32. How INSERT is different from ALTER command in SQL. 2
33. Find and write the output of the following Python code : 2
Str1="PREBOARD2020"
Str2=""
I=0
while I<len(Str1):
if Str1[I]>="A" and Str1[I]<="R":

5
Str2=Str2+Str1[I+1]
elif Str1[I]>="0" and Str1[I]<="9":
Str2=Str2+ (Str1[I-1])
else:
Str2=Str2+"*"
I=I+1
print(Str2)
Section-II
34. Write definition of a method ODDSum(NUMBERS) to add those values in the list of 3
NUMBERS, which are odd.
Sample Input Data of the List
NUMBERS=[20,40,10,5,12,11]
OUTPUT is 16
35. Write a method cnt_M() in Python to read lines from a text file ‘MYNOTES.TXT’, and 3
display those lines, which are starting with the alphabet ‘M’‖.
If the “MYNOTES.TXT” contents are as follows:
My first book was
Me and My Family.
It gave me chance to be
Known to the world.
The output of the function should be:
Count of lines starting with M is: 2
OR
Write a method/function LARGEWORDS() in Python to read contents from a text file
CODE.TXT, to count and display the occurrence of those words, which are having 7
or more alphabets.
For example :
If the content of the file is
ME AND MY FRIENDS
ENSURE SAFETY AND SECURITY OF
EVERYONE
The output of the function should be: 3

36. Write the outputs of the SQL queries (i) to (iii) based on relations EMP and DESIG 3
given below:

Table: EMP
E_ID Name Gender Age DOJ Designation
1 Om Prakash M 35 10/11/2009 Manager
2 Jai Kishan M 32 12/05/2013 Accountant
3 Shreya Sharma F 30 05/02/2015 Clerk
4 Rakesh Minhas M 40 15/05/2007 Manager
5 Himani Singh F 33 19/09/2010 Clerk

6
Table: DESIG
Salary E_ID DEPT_ID
45000 1 D101
35000 2 D102
45000 4 D101

i) SELECT Designation, count(*) FROM EMP GROUP BY Designation;


ii) SELECT AVG(Age) FROM EMP;
iii) SELECT EMP.Name, EMP.Designation,DESIG.Salary FROM EMP, DESIG WHERE
EMP.E_ID = DESIG.E_ID AND EMP.Age>35;
37. Write a function in Python PUSH(Num), where Num is a list of integer numbers. 3
From this list push all positive even numbers 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(cities), where cities is a stack implemented by a list
of city names for eg. cities=[‘Delhi’, ’Jaipur’, ‘Mumbai’, ‘Nagpur’]. The function
returns the value deleted from the stack.

Section-III
38. Biyani Design and Training Institute is setting up its center in Jaipur with four 5
specialized units for Design, Media, HR and Training in separate buildings. The
physical distances between these units and the number of computers to be
installed in these units are given as follows.
You as a network expert, have to answer the queries as raised by the administrator
as given in (i) to (v).
Shortest distances between various locations in meters :

Design Unit to Media Unit 60


Design Unit to HR Unit 40
Design Unit to Training Unit 60
Media Unit to Training Unit 100
Media Unit to HR Unit 50
Training Unit to HR Unit 60

Number of computers installed at various locations are as follows:

Design Unit 40
Media Unit 50
HR Unit 110
Training Unit 40

7
HR

DESIGN
TRAINING

MEDIA

a)Suggest the most suitable place (i.e.,Unit/Building) to install the server of this
Institute.
b) Suggest an ideal layout for connecting these Unit/Building for a wired
connectivity.
c) Suggest the devices to be installed in each of these buildings for connecting
computers installed within each of the units out of the following :
Modem, Switch, Gateway, Router
d) Suggest an efficient as well as economic wired medium to be used within each
unit for connecting computer systems out of the following network cable :
Co-axial Cable, Ethernet Cable, Single Pair Telephone Cable.
e) The institute is planning to connect its admission office in Bangalore, which is
1960km from institute. Which type of network out of LAN, MAN or WAN will be
formed ? Justify your answer.
39. Consider the following tables WORKERS and DESIG. Write SQL commands for the 5
statements (i) to (iv) and give outputs for SQL queries (v) to (viii) :

WORKERS
W_ID FIRSTNAME LASTNAME GENDER ADDRESS CITY
102 Sam Tones M 33 Elm St Paris
105 Sarah Ackerman F U.S. 110 New York
144 Manila Sengupta F 24 Friends Street New Delhi
210 George Smith M 83 First Street Howard
255 Mary Jones F 842,Vine Ave. Losantiville
300 Robert Samuel M 9 Fifth Cross Washington
335 Henry Williams M 12 Moore Street Boston
403 Ronny Lee M 121 Harrison St. New York
451 Pat Thompson M 11 Red Road Paris

8
DESIG
W_ID SALARY BENEFITS DESIGNATION
102 75000 15000 Manager
105 85000 25000 Director
144 70000 15000 Manager
210 75000 12500 Manager
255 50000 12000 Clerk
300 45000 10000 Clerk
335 40000 10000 Clerk
400 32000 7500 Salesman
451 28000 7500 Salesman
(i) To display W_ID, Firstname, Address and City of all employees living in New York
from the table WORKERS.
(ii) To display the content of WORKERS table in ascending order of LASTNAME.
(iii) To display First Name, Worker ID and Address of male Workers only.
(iv) To display the Minimum salary among Managers and Clerks from the table DESIG.
(v) To display First Name and Salary from Workers and Desig Table for each worker.

40. A binary file “STOCK.DAT” has structure [ITEMID, ITEMNAME, QUANTITY, PRICE]. 5
(i) Write a user defined function MakeFile( ) to input data for a record and add to
Book.dat.
(ii) Write a function GetPrice(ITEMID) in Python which accepts the ITEMID as
parameter and return PRICE of the Item stored in Binary file STOCK.DAT.
OR
A binary file “EMPLOYEE.DAT” has structure (EMPID, EMPNAME, SALARY). Write a function
CountRec( ) in Python that would read contents of the file “EMPLOYEE.DAT” and display the
details of those Employees whose Salary is above 20000. Also display number of employees
having Salary more than 20000.

You might also like