0% found this document useful (0 votes)
14 views10 pages

Bhopal Set 1 - QP

Sample paper

Uploaded by

karan.s8tha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Bhopal Set 1 - QP

Sample paper

Uploaded by

karan.s8tha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

XII/PB/2021/CS/SET-1

Kendriya Vidyalaya Sangathan, Regional Office, Bhopal


Pre-Board Examination 2020-21
Class- XII(Computer Science (083))
M.M.:70 Time: 3 hrs.
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 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 questions
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 no 1 to 21.
1. Find the invalid identifier from the following
1
a) def b) For c)_bonus d)First_Name
2. Given the lists Lst=[‘C’,’O’,’M’,’P’,’U’,’T’,’E’,’R’] , write the output of:
1
print(Lst[3:6])
3. Function of writer object is used to send data to csv file to store. 1
4. What will be the output of following program:
a='hello' b='virat' 1

for i in range(len(a)): print(a[i],b[i])


5. Give Output:
colors=["violet", "indigo", "blue", "green", "yellow", "orange", "red"]
del colors[4]
1
colors.remove("blue")
colors.pop(3)
print(colors)
6. Which statement is correct for dictionary?
(i) A dictionary is a ordered set of key:value pair
(ii) each of the keys within a dictionary must be unique 1
(iii) each of the values in the dictionary must be unique
(iv) values in the dictionary are immutable

Page 1 of 9
XII/PB/2021/CS/SET-1

7. Identify the valid declaration of Rec:


Rec=(1,‟Vikrant,50000) 1
(i)List (ii)Tuple (iii)String (iv)Dictionary
8. Find and write the output of the following python code:
def myfunc(a):
a=a+2
1
a=a*2
return a
print(myfunc(2))
9. Name the protocol that is used to transfer file from one computer to another. 1
10. Raj is a social worker, one day he noticed someone is writing insulting or demeaning
1
comments on his post. What kind of Cybercrime Raj is facing?
11. Which command is used to change the existing information of table? 1
12. Expand the term: RDBMS 1
13. Write an Aggregate function that is used in MySQL to find No. of Rows in the
1
database Table
14. For each attribute of a relation, there is a set of permitted values, called the of
that attribute.
a. Dictionaries
1
b. Domain
c. Directory
d. Relation

15. Name the Transmission media which consists of an inner copper core and a second
1
conducting outer sheath.
16. Identify the valid statement for list L=[1,2,”a”]:
(i) L.remove("2")
(ii) L.del(2) 1
(iii) del L[2]
(iv) del L[“a”]
17. Find and write the output of the following python code:
x = "Python"
1
print(x[ : :-1])
print(x)
18. In SQL, write the query to display the list of databases stored in MySQL. 1

Page 2 of 9
XII/PB/2021/CS/SET-1
19. Write the expanded form of GPRS? 1
20. Which is not a constraint in SQL?
a) Unique
b) Distinct 1
c) Primary key
d) check
21. Define Bandwidth? 1
Section-II
Both the Case study based questions are compulsory. Attempt any 4 sub parts from
each question. Each question carries 1 mark

22. Observe the following table and answer the question (a) to (e) (Any 04)
TABLE: VISITOR
VisitorID VisitorName ContactNumber
V001 ANAND 9898989898
V002 AMIT 9797979797
V003 SHYAM 9696969696
V004 MOHAN 9595959595
(a) Write the name of most appropriate columns which can be considered as
1
Candidate keys?
(b) Out of selected candidate keys, which one will be the best to choose as Primary
1
Key?
(c) What is the degree and cardinality of the table? 1
(d) Insert the following data into the attributes VisitorID, VisitorName and
ContactNumber respectively in the given table VISITOR. 1
VisitorID = “V004”, VisitorName= “VISHESH” and ContactNumber= 9907607474
(e) Remove the table VISITOR from the database HOTEL. Which command will he
used from the following:
a) DELETE FROM VISITOR;
1
b) DROP TABLE VISITOR;

c) DROP DATABASE HOTEL;


d) DELETE VISITOR FROM HOTEL;

23. Priti of class 12 is writing a program to create a CSV file “emp.csv”. She has written
the following code to read the content of file emp.csv and display the employee record
whose name begins from “S‟ also show no. of employee with first letter “S‟ out of total
record. As a programmer, help her to successfully execute the given task.
Consider the following CSV file (emp.csv):

Page 3 of 9
XII/PB/2021/CS/SET-1
1,Peter,3500
2,Scott,4000
3,Harry,5000
4,Michael,2500
5,Sam,4200

import ________ # Line 1


def SNAMES():
with open(_________) as csvfile: # Line 2
myreader = csv._______(csvfile, delimiter=',') # Line 3
count_rec=0
count_s=0
for row in myreader:
if row[1][0].lower()=='s':
print(row[0],',',row[1],',',row[2])
count_s+=1
count_rec+=1
print("Number of 'S' names are ",count_s,"/",count_rec)
(a) Name the module he should import in Line 1 1
(b) In which mode, Priti should open the file to print data. 1
(c) Fill in the blank in Line 2 to open the file. 1
(d) Fill in the blank in Line3 to read the data from a csv file. 1
(e) Write the output he will obtain while executing the above program. 1
PART-B
Section-I
24. If given A=2,B=1,C=3, What will be the output of following expressions:
(i) print((A>B) and (B>C) or(C>A)) 2
(ii) print(A**B**C)
25 What is Trojan? Any two type of activities performed by Trojan
OR 2
What is the difference between HTML and XML?
26 Expand the following terms:
2
a. HTTP b. POP3 c. VOIP d.TCP
27 What do you understand the default argument in function? Which function parameter
must be given default argument if it is used? Give example of function header to
illustrate default argument
OR
Ravi a python programmer is working on a project, for some requirement, he has to
define a function with name CalculateInterest(), he defined it as: 2
def CalculateInterest (Principal, Rate=.06,Time): # code
But this code is not working, Can you help Ravi to identify the error in the above function
and what is the solution.

Page 4 of 9
XII/PB/2021/CS/SET-1
28 Rewrite the following Python program after removing all the syntactical errors (if
any), underlining each correction:
def checkval:
x = input("Enter a number")
if x % 2 =0:
2
print (x, "is even")
elseif x<0:
print (x, "should be positive")
else;
print (x, "is odd")
29 What possible outputs(s) are expected to be displayed on screen at the time of
execution of the program from the following code? Also specify the maximum values
that can be assigned to each of the variables FROM and TO.

import random
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3) 2
TO=random.randint(2,4)
for K in range(FROM,TO):
print (AR[K],end=”#“)

(i)10#40#70# (ii)30#40#50# (iii)50#60#70# (iv)40#50#70#


30 Define Primary Key of a relation in SQL. Give an Example using a dummy table. 2
31 Consider the following Python code is written to access the record of CODE passed
to function: Complete the missing statements:

def Search(eno):
#Assume basic setup import, connection and cursor is created 2
query="select * from emp where empno=________".format(eno)
mycursor.execute(query)
results = mycursor._________
print(results)
32 Differentiate between DDL and DML with one Example each. 2

33 What will be the output of following program:


s="welcome2kv"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper() 2
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'#'
print(m)

Page 5 of 9
XII/PB/2021/CS/SET-1
Section-II
34 Write code in Python to calculate and display the frequency of each item in a list. 3

35 Write a function COUNT_AND( ) in Python to read the text file “STORY.TXT” and
count the number of times “AND” occurs in the file. (include AND/and/And in the
counting)
3
OR
Write a function DISPLAYWORDS( ) in python to display the count of words starting
with “t” or “T” in a text file ‘STORY.TXT’.
36 Write a output for SQL queries (i) to (iii), which are based on the table: SCHOOL and
ADMIN given below:
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3
1167 HARISH B CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16

TABLE: ADMIN
CODE GENDER DESIGNATION 3
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD

i) SELECT SUM (PERIODS), SUBJECT FROM SCHOOL GROUP BY SUBJECT;


ii) SELECT TEACHERNAME, GENDER FROM SCHOOL, ADMIN WHERE
DESIGNATION = ‘COORDINATOR’ AND SCHOOL.CODE=ADMIN.CODE;
iii) SELECT COUNT (DISTINCT SUBJECT) FROM SCHOOL;

Page 6 of 9
XII/PB/2021/CS/SET-1

37 Write a program to perform push operations on a Stack containing Student details as


given in the following definition of student node: 3

RNo integer
Name String
Age integer
def isEmpty(stk):
if stk == [ ]:
return True
else:
return False
def stk_push(stk, item):
# Write the code to push student details using stack.
OR

Write a program to perform pop operations on a Stack containing Student details as


given in the following definition of student node:
RNo integer
Name String
Age integer

def isEmpty(stk):
if stk == [ ]:
return True
else:
return False
def stk_pop(stk):
# Write the code to pop a student using stack.
Section-III
38 PVS Computers decided to open a new office at Ernakulum, the office consist of Five
Buildings and each contains number of computers. The details are shown below.

Building-2 5
Building-1 Building-3

Building-5 Building-4

Page 7 of 9
XII/PB/2021/CS/SET-1
Distance between the buildings
Building No of computers
Building 1 and 2 20 Meters
1 40
Building 2 and 3 50 Meters
2 45
Building 3 and 4 120 Meters
3 110
Building 3 and 5 70 Meters
4 70
Building 1 and 5 65 Meters
5 60
Building 2 and 5 50 Meters

Computers in each building are networked but buildings are not networked so far. The
Company has now decided to connect building also.
(i) Suggest a cable layout for connecting the buildings
(ii) Do you think anywhere Repeaters required in the campus? Why
(iii) The company wants to link this office to their head office at Delhi
(a) Which type of transmission medium is appropriate for such a link?
(b) What type of network would this connection result into?
(iv) Where server is to be installed? Why?
(v) Suggest the wired Transmission Media used to connect all buildings efficiently.
39 Write SQL queries for (i) to (v), which are based on the table: SCHOOL and ADMIN
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIODS EXPERIENCE
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3
1167 HARISH B CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16 5
TABLE: ADMIN
CODE GENDER DESIGNATION
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD

Page 8 of 9
XII/PB/2021/CS/SET-1

i) To decrease period by 10% of the teachers of English subject.


ii) To display TEACHERNAME, CODE and DESIGNATION from tables SCHOOL and
ADMIN whose gender is male.
iii) To Display number of teachers in each subject.
iv) To display details of all teachers who have joined the school after 01/01/1999 in
descending order of experience.
v) Delete all the entries of those teachers whose experience is less than 10 years in
SCHOOL table.
40 Write a function SCOUNT( ) to read the content of binary file “NAMES.DAT‟ and
display number of records (each name occupies 20 bytes in file ) where name begins
from “S‟ in it.
For. e.g. if the content of file is:
SACHIN
AMIT
AMAN
SUSHIL
DEEPAK
HARI SHANKER
Function should display
Total Names beginning from “S” are 2 5
OR
Consider the following CSV file (emp.csv):

Sl,name,salary

1,Peter,3500
2,Scott,4000
3,Harry,5000
4,Michael,2500
5,Sam,4200
Write Python function DISPEMP( ) to read the content of file emp.csv and display only
those records where salary is 4000 or above

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

Page 9 of 9

You might also like