XIIComp SC S E 157 PDF
XIIComp SC S E 157 PDF
General Instructions:
● All questions are compulsory.
● Question paper is divided into 4 sections A, B, C and D.
Section A : Unit-1
Section B : Unit-2
Section C: Unit-3
Section D: Unit-4
SECTION-A
Q1. (a) Which of the following is valid logical operator in Python: 1
(i) % (ii) : (iii) == (iv) or
(b) Write the type of tokens from the following : 1
(i) for (ii) Num
(c) Name the Python Library modules which need to be imported to invoke the 1
following functions: (i) exp( ) (ii) randint ()
(d) Rewrite the following code in python after removing all syntax error(s). 2
Underline each correction done in the code.
Num = input("Number:")
Sum = 0
for i in range(10,Num,3)
Sum+=i
if i%2=0:
print ( i*2)
Else:
print ( i*3 print Sum)
1
(e) Find and write the output of the following python code: 2
def ChangeList():
L=[]
L1=[]
L2=[]
for i in range(1,10):
L.append(i)
for i in range(10,1,–2):
L1.append(i)
for i in range(len(L1)):
L2.append(L1[i]+L[i])
L2.append(len(L)-len(L1))
print(L2)
ChangeList()
(f) Find and write the output of the following python code: 3
def makenew(mystr):
newstr = ""
count = 0
for i in mystr:
if count%2 != 0:
newstr = newstr + str(count)
else:
if i.islower():
newstr = newstr + i.upper()
else:
newstr = newstr + i
count += 1
newstr = newstr + mystr[:1]
print("The new string is:", newstr)
makenew("sTUdeNT")
(g) Study the following program and select the possible output(s) from the options (i)
to (iv) following it. Also, write the maximum and the minimum values that can be
assigned to the variable Y. 2
Import random
X= random.random()
Y= random.randint(0,4)
print int (X),”:”, Y+ int(X)
(c) Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]? 1
(d) Find and write the output of the following python code: 1
def sum(a,b,c):
return a+5, b+4, c+7
s1, s2, s3=sum(2, 3, 4)
print(s1, s2, s3)
(e) Find and write the output of the following python code: 1
x=5
def funct2():
x=3
global x x=x+1
print x
[
(f) Write the specific purpose of functions used in plotting: 2
i) plot()
ii) Legend()
(g) Write a python code to draw the following pia chart 2
OR
Give the output from the given python code:
import matplotlib.pyplot as pl
import numpy as np
boy=[28,45,10,30]
girl=[14,20,36,50]
X=np.arange(4) # creates a list of 4 values [0,1,2,3]
pl.bar(X, boy, width=0.2, color='r', label="boys")
pl.bar(X+0.2, girl, width=0.2,color='b',label="girls")
3
pl.legend(loc="upper left")
pl.title("Admissions per week")
pl.xlabel("week")
pl.ylabel("admissions")
pl.show( )
(h) Write a Python program to find the number of words in a text file. 2
OR
Write a Python program to count all the line having 'a' as last character
(j) Write a program in Python to arrange the elements using Bubble sort
technique. Also show the passes. The elements are 4,13,1,7 4
OR
Write a function in python, PushEl(element) and MakeEl(element) to add a new
element and delete a element from a List of element Description, considering
them to act as push and pop operations of the Stack data structure .
SECTION-B
Q3. Questions 3 (a) to 3 (d) : Fill in the blanks
(a) __________ command is used to get the registration records about the domain
such as who registered, when it was registered, expiry data etc. 1
(b) __________ is the example of MAC address 1
(c) __________a device that amplifies a signal being transmitted on the network 1
(d)________is used to connect Ethernet cable to a computer or a labtop 1
(e) Give the full forms of the following 2
i) POP3 ii) TCP/IP iii) VoIP iv) GSM
(f) Look at the image given below and answer questions that follow : 2
(h) Knowledge Allaround Organization has set up its new centre at Mumbai for its
office and web based activities. It has 4 blocks of building as shown in the
diagram below 4
SECTION-C
Q.5 (a) It is an electronic discovery technique used to determine and reveal technical
criminal evidence. Write the name. 1
(b) What is Identity Theft? 1
(c) What are Intellectual Property Rights (IPR)? Give one Example. 2
(d) What steps should be taken to prevent Phishing attack? 2
(e) Suggest a way for disposal of used electronic gadgets 2
(f) Enumerate any two gender issues while teaching and using computers 2
7
KENDRIYA VIDYALAYA SANGATHAN (MUMBAI REGION)
I- Board Examination (2019-20)
Class XII
Computer Science (Code 083)
Marking scheme
Max Marks: 70 Time Duration: 3 Hrs.
General Instructions:
SECTION-A
Q1. (a) or 1
(b) (i) Key word (ii) Identifier 1
(c) (i) math (ii) random 1
Rewrite the following code in python after removing all syntax
(d) 2
error(s). Underline each correction done in the code.
Num = int("Number:")
Sum = 0
for i in range(10,Num,3):
Sum+=i
if i%2=0:
print i*2
else:
print (i*3)
print (Sum)
(e) [11,10,9,8,7,4] 2
(f) S1U3E5Ts 3
i) and iv) are the possible output(s)
(g) 2
Minimum value that can be assigned to Y = 0 Maximum value assigned to Y
=3
( ½ mark for each correct possible output)
( ½ mark for each correct possible minimum and maximum value)
Q2. (a) Correct use of else in loop 1
(b) a, b and c 1
(c) 25
1
8
(d) 7 7 11 1
(e) 5
1
i) plot(): A line chart or line graph can be created using the plot() function
(f) 2
available in pyplot library. For example, the basic syntax for creating line
plots is plt.plot(x,y), where x and y are the points or specify the (x, y) pairs
that form the line.
ii) Legend(): legend is the text or string that “has to be read” to understand
the graph. Legends are used in line graphs to explain the function or the
values underlying the different lines of the graph.
import matplotlib.pyplot as pl
(g) 2
part=[12,9,69,10]
clr=['g','m','y','c']
ex=[0, 0.2, 0, 0]
pl.pie(part, colors=clr, labels=['abc','pqr','xyz','def'], autopct='%1.1f%%',
explode=ex)
pl.show( )
OR
f=open("abc.txt","r")
(h) 2
linesList=f.readlines()
count=0
for line in linesList:
wordsList=line.split()
print(wordsList)
count = count+ len(wordsList)
print("The number of words in this file are : ",count)
f.close()
OR
count =0
f=open("abc.txt","r")
data=f.readlines()
print(data)
for line in data:
if line[-2] == 'a':
count=count+1
print("Number of lines having 'a' as last character is/are : " ,count)
f.close()
9
def SearchBinary (A,l,R,X):
(i) 3
if R >= l:
mid = l + (R-l)//2
if Arr[mid] == X:
return mid
elif Arr[mid] > X:
return SearchBinary (A,l,mid-1,X)
else:
return SearchBinary (A,mid+1,r,X)
else:
return -1
A = [ 2, 3, 4, 10, 40 ]
X =int(input(' enter element to be searched'))
result = SearchBinary (A,0,len(A)-1,X)
if result != -1:
print ("Element is present at index ", result)
else:
print ("Element is not present in array")
(1/2 mark for mid)
(1/2 mark for return mid)
(1 mark each for returning function)
(1 mark for invoking function)
OR
def fibonacci(n):
if n<=1:
return n
else:
return(fibonacci(n-1)+fibonacci(n-2))
.
1
0
OR
def PushEl(element):
a=int(input("enter package title : "))
element.append(a)
def PopEl(element):
if (element==[]):
print( "Stack empty")
else:
print ("Deleted element:", element.pop())
(½ mark for PushEl() header)
( ½ mark for accepting a value from user)
( ½ mark for adding value in list)
( ½ mark for PopEl() header)
( ½ mark for checking empty list condition)
( ½ mark for displaying “Stack empty”)
( ½ mark for displaying the value to be deleted)
( ½ mark for deleting value from list)
SECTION-B
3 Questions 3 (a) to 3 (c) : Fill in the blanks
(a) WHOIS 1
10:B5:03:63:2E:FC or any example
(b) 1
(c) Repeater. 1
(d) Ethernet port 1
(e) Give the full forms of the following 2
I. Post Office Protocol version3
II. Transmission Control Protocol/Internet Protocol
III. Voice over Internet Protocol
IV. Global System Mobile Communication
(i) The command is Ping.
(f) 2
(ii) Ping is used to test connectivity between two hosts. It checks if there is
a connection to the remote machine.
(a) This is a case of Plagiarism (Stealing)
(g) 3
(b) The producer may have to face huge fine and penalties in this case.
(c) Cyber Stalking
1
1
(h)
4
SECTION-C
1
3