10 - Ms Compt 2020
10 - Ms Compt 2020
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #1/16]
15. The Board permits candidates to obtain a photocopy of the Answer Book on request in an RTI
application and also separately as a part of the re-evaluation process on payment of the processing
charges.
Specific Instructions:
● All programming questions have to be answered with respect to C++ Language / Python
only
● In C++ / Python, ignore case sensitivity for identifiers (Variable / Functions / Structures /
Class Names)
● In Python indentation is mandatory, however, the number of spaces used for indenting
may vary
● In SQL related questions – both ways of text/character entries should be acceptable for
Example: “AMAR” and ‘amar’ both are acceptable.
● In SQL related questions – all date entries should be acceptable for Example:
‘YYYY-MM-DD’, ‘YY-MM-DD’, ‘DD-Mon-YY’, “DD/MM/YY”, ‘DD/MM/YY’, “MM/DD/YY”,
‘MM/DD/YY’ and {MM/DD/YY} are correct.
● In SQL related questions – semicolon should be ignored for terminating the SQL
statements
● In SQL related questions, ignore case sensitivity.
SECTION A
Q1 (a) Which of the following is not a valid variable name in Python. Justify reason for [1]
it not being a valid name:
(i) 5Radius (ii)Radius_ (iii) _Radius (iv) Radius
Ans (i) 5Radius
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #2/16]
Ans W=input('Enter a word') //Error 1
if W == 'Hello' : //Error 2,Error 3
print('Ok')
else : //Error 4
print('Not Ok')
(½ Marks for writing correction for Error 1)
(½ Marks for writing correction for Error 2
(½ Marks for writing correction for Error 3)
(½ Marks for writing correction for Error 4)
NOTE:
(1 mark for only identifying all the errors without writing corrections)
(e) Find and write the output of the following python code: [2]
def ChangeVal(M,N):
for i in range(N):
if M[i]%5 == 0 :
M[i] //= 5
if M[i]%3 == 0 :
M[i] //= 3
L=[ 25,8,75,12]
ChangeVal(L,4)
for i in L :
print(i, end='#')
Ans 5#8#5#4#
(½ Mark for writing each correct value)
OR
(Only ½ Mark for writing all ‘#’ at proper places)
Note:
● Deduct only ½ Mark for not considering any or all correct placements of #
(f) Find and write the output of the following python code: [3]
def Call(P=40,Q=20):
P=P+Q
Q=P-Q
print(P,'@',Q)
return P
R=200
S=100
R=Call(R,S)
print (R,'@',S)
S=Call(S)
print(R,'@',S)
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #3/16]
(1½ Mark for writing each correct 2 lines of output)
NOTE:
Deduct only ½ Mark for not considering any or all line break
(g) What possible outputs(s) are expected to be displayed on screen at the time of [2]
execution of the program from the following code? Also specify the minimum
and maximum values that can be assigned to the variable End .
import random
Colours = ["VIOLET","INDIGO","BLUE","GREEN",
"YELLOW","ORANGE","RED"]
End = randrange(2)+3
Begin = randrange(End)+1
for i in range(Begin,End):
print(Colours[i],end="&")
Q2 (a) Write the names of the immutable data objects from the following: [1]
(i) List (ii) Tuple (iii) String (iv) Dictionary
Ans (ii) Tuple (iii) String
(½ Mark for writing each correct option)
(b) Write a Python statement to declare a Dictionary named ClassRoll with Keys [1]
as 1,2,3 and corresponding values as 'Reena', 'Rakesh', 'Zareen'
respectively.
Ans ClassRoll = {1:"Reena", 2:"Rakesh", 3:"Zareen"}
(1 Mark for writing correct declaration statement)
(c) Which of the option out of (i) to (iv) is the correct data type for the [1]
variable Vowels as defined in the following Python statement:
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #4/16]
(1 Mark for writing correct output)
(e) Write the output of the following Python code: [1]
def Update(X=10):
X += 15
print( 'X = ', X)
X=20
Update()
print( 'X = ', X)
Ans X = 25
X = 20
(½ Mark for writing each correct line of output)
(f) Differentiate between “w” and “r” file modes used in Python while opening a [2]
data file. Illustrate the difference using suitable examples.
Ans A file is opened using “w” mode to write content into the file.
A file is opened using “r” mode to read content into the file.
Example:
def Create():
file=open('NOTES.TXT','w')
S="This is a sample"
file.write(S)
file.close()
def Read():
file=open('NOTES.TXT','r')
Lines=file.readline();
print(Lines)
file.close()
Create();
Read();
(½ Mark for writing correct usage of ’w’ mode)
(½ Mark for writing correct usage of ’r’ mode)
(g) A pie chart is to be drawn(using pyplot) to represent Pollution Level of Cities. [2]
Write appropriate statements in Python to provide labels for the pie slices as
the names of the Cities and the size of each pie slice representing the
corresponding Pollution of the Cities as per the following table:
Cities Pollution
Mumbai 350
Delhi 475
Chennai 315
Bangalore 390
Ans
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #6/16]
The file contains many sentences.
Ans def Show_words():
file=open('NOTES.TXT','r')
Lines = file.readlines()
for L in Lines:
W=L.split()
if (len(W)==5):
print(L)
file.close()
(½ Mark for correctly opening the file)
(½ Mark for reading all lines)
(½ Mark for correct loop to iterate for each line)
(½ Mark for displaying each line having 5 words in it)
(i) Write a Recursive function in Python RecsumNat(N), to return the sum of [3]
the first N natural numbers. For example, if N is 10 then the function
should return (1 + 2 + 3 + ... + 10 = 55).
Ans def RecsumNat(N):
if N==1:
return N
else:
return N+RecsumNat(N-1)
(1 Mark for checking the recursion termination condition)
(1 Mark for returning correct value on recursion termination)
(1 Mark for returning correct value on recursion)
OR
Write a Recursive function in Python Power(X,N), to return the result of X
raised to the power N where X and N are non-negative integers. For example, if
X is 5 and N is 3 then the function should return the result of(5)3 i.e. 125
Ans def Power(X,N):
if N==1:
return X
else:
return X*Power(X,N-1)
(1 Mark for checking the recursion termination condition)
(1 Mark for returning correct value on recursion termination)
(1 Mark for returning correct value on recursion)
(j) Write functions in Python for PushS(List) and for PopS(List) for performing Push [4]
and Pop operations with a stack of List containing integers.
Ans def PushS(List):
N=int(input("Enter integer"))
List.append(N)
def PopS(List):
if (List==[]):
print("Stack empty")
else:
print ("Deleted integer :",List.pop())
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #7/16]
(½ Mark for writing correct PushS() header)
(½ Mark for writing correct input for integer)
(½ Mark for adding the entered integer into the List)
(½ Mark for writing correct PopS() header)
(½ Mark for checking empty list condition)
(½ Mark for displaying “Stack empty”)
(1 Mark for displaying and deleting value from the list)
OR
Write functions in Python for InsertQ(Names) and for RemoveQ(Names) for
performing insertion and removal operations with a queue of List which
contains names of students.
Ans def InsertQ(Names):
Name=input("enter Name to be inserted: ")
List.append(Name)
def DeleteQ(Names):
if (Names==[]):
print("Queue empty")
else:
print ("Deleted integer is: ",Names[0])
del(Names[0])
(½ Mark for writing correct InsertQ header)
(½ Mark for accepting a name from user)
(½ Mark for adding the entered name in the List)
(½ Mark for writing correct DeleteQ header)
(½ Mark for checking empty queue condition)
(½ Mark for displaying “Queue empty”)
(½ Mark for displaying the name to be deleted)
(½ Mark for deleting name from the List)
SECTION B
(b) _________ is a network tool used to test the download and upload broadband [1]
speed.
Ans Speedtest
(d) _______________ is a network tool used to determine the path packets take [1]
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #8/16]
from one IP address to another.
Ans Traceroute
(f) Match the ServiceNames listed in the first column of the following table with [2]
their corresponding features listed in the second column of the table:
Technology Feature
1G ● IP based Protocols (LTE)
● True Mobile Broadband
2G ● Improved Data Services with Multimedia
● Mobile Broadband
3G ● Basic Voice Services
● Analog-based protocol
4G ● Better Voice Services
● Basic Data Services
● First digital standards (GSM,CDMA)
(g) What is a secure communication? Differentiate between HTTP and HTTPS. [3]
Ans Secure communication is when two entities are communicating and do not
want a third party to listen in.
The primary difference between HTTP (Hypertext Transfer Protocol) and HTTPS
(Hypertext Transfer Protocol Secure) is that HTTP is not secure whereas HTTPS
is a secure protocol which uses TLS/SSL certificate to ensure the authentication.
(1 mark for writing correct explanation of Secure Communication)
(1 mark for writing correct explanation HTTP)
(1 mark for writing correct explanation HTTPS)
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #9/16]
(h) Helping Hands is an NGO with its head office at Mumbai and branches located at [4]
Delhi, Kolkata and Chennai. Their Head Office located at Delhi needs a
communication network to be established between the head office and all the
branch offices. The NGO has received a grant from the national government for
setting up the network. The physical distances between the branch offices and
the head office and the number of computers to be installed in each of these
branch offices and the head office are given below. You as a network expert
have to suggest the best possible solutions for the queries as raised by the NGO.
as given in (i) to (iv).
Distances between various locations in Kilometres:
Mumbai H.O. to Delhi 1420
Mumbai H.O. to Kolkata 1640
Mumbai H.O. to Chennai 2710
Delhi to Kolkata 1430
Delhi to Chennai 1870
Chennai to Kolkata 1750
(i) Suggest by drawing the best cable layout for effective network connectivity
of all the Branches and the Head Office for communicating data.
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #10/16]
Ans
(ii) Suggest the most suitable location to install the main server of this NGO to
communicate data with all the offices.
Ans MUMBAI H.O.
(iii) Write the name of the type of network out of the following, which will be
formed by connecting all the computer systems across the network:
(A) WAN (B)MAN (C) LAN (D) PAN
Ans (A) WAN
(iv) Suggest the most suitable medium for connecting the computers installed
across the network out of the following:
(A) Optical Fibre (B) Telephone wires (C) Radio Waves (D) Ethernet cable
SECTION C
Q4 (a) Which SQL command is used to add a new attribute in a table? [1]
(b) Which SQL aggregate function is used to count all records of a table ? [1]
Ans COUNT(*)
(c) Which clause is used with a SELECT command in SQL to display the records in [1]
ascending order of an attribute?
Ans ORDER BY
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #11/16]
(d) Write the full form of the following abbreviations: [1]
(i) DDL (ii) DML
Ans (i) DDL : Data Definition Language
(ii) DML : Data Manipulation Language
(½ Mark for writing correct full form of DDL)
(½ Mark for writing correct full form of DML)
(e) Observe the following table EMPLOYEES and DEPARTMENT carefully and answer [2]
the questions that follow:
(i) What is the Degree of the table EMPLOYEES ? What is the cardinality of the
table DEPARTMENT?
Ans Degree of the table EMPLOYEES = 4
Cardinality of the table DEPARTMENT = 3
(½ Mark for writing correct Degree of the table EMPLOYEES)
(½ Mark for writing correct Cardinality of the table DEPARTMENT)
(ii) What is a Primary Key ? Explain.
Ans A Primary Key is an attribute of a Table which has a unique value for
each of the records and can be used to identify a record of the table.
OR
Any equivalent explanation conveying the correct explanation for a
Primary Key
(1 Mark for writing the correct explanation for Primary Key)
OR
Differentiate between Selection and Projection operations in context of a
Relational Database. Also, illustrate the difference with one supporting
example of each.
Ans Selection : Operation upon a relation to select a horizontal subset of
the relation.
Projection : Operation upon a relation to select a vertical subset of the
relation.
Example:
TABLE: EMPLOYEES
ENO ENAME DOJ DNO
E1 NUSRAT 2001-11-21 D3
E2 KABIR 2005-10-25 D1
A selection upon Employees for tuples whose DOJ is in the year 2005 will result
into
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #12/16]
TABLE: EMPLOYEES
ENO ENAME DOJ DNO
E2 KABIR 2005-10-25 D1
A projection upon Employees for ENAME and DOJ of all Employees will result
into
TABLE: EMPLOYEES
ENAME DOJ
NUSRAT 2001-11-21
KABIR 2005-10-25
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #13/16]
Ans MAX(PUR_DATE)
2019-05-09
(½ Mark for writing correct output with or without column headings)
(h) Write SQL queries for (i) to (iv), which are based on the tables: CUSTOMERS and [4]
PURCHASES given in the question 4(g):
(i) To display details of all CUSTOMERS whose CITIES are neither Delhi nor
Mumbai
Ans SELECT * FROM CUSTOMERS WHERE CITIES NOT
IN('DELHI','MUMBAI');
OR
SELECT * FROM CUSTOMERS WHERE CITIES<>'DELHI' AND
CITIES<>'MUMBAI';
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #14/16]
Ans (C) E-Waste
(1 Mark for writing the correct option)
(b) Data which has no restriction of usage and is freely available to everyone under [1]
Intellectual Property Rights is categorised as:
(A) Open Source (B) Open Data (C) Open Content (D) Open Education
Ans (B) Open Data
(1 Mark for writing the correct option)
(c) What is a Unique Id? Write the name of the Unique Identification provided by [2]
Government of India for Indian Citizens.
Ans Unique identifier (UID) is any identifier which is guaranteed to be unique among
all objects and is used for identifying various objects.
The Unique Identification provided by the Government of India for Indian
Citizens is Aadhaar.
(1 Mark for writing the correct explanation for Unique Id)
(1 Mark for writing the correct name of the Unique Id)
(d) Consider the following scenario and answer the questions which follow: [2]
“A student is expected to write a research paper on a topic. The
student had a friend who took a similar class five years ago. The
student asks his older friend for a copy of his paper and then takes
the paper and then submits the entire paper as his own research work
”
(i) Which of the following activities appropriately categorises the act of the
writer:
(A) Plagiarism (B) Spamming (C) Virus (D) Phishing
(ii) Which kind of offense out of the following is made by the student?
(A) Cyber Crime (B) Civil Crime (C) Violation of Intellectual Property
Rights
Ans (i) (A) Plagiarism
(ii) (C) Violation of Intellectual Property Rights
(1 Mark for writing the correct option)
(1 Mark for writing the correct option)
(e) What are Digital Rights? Write examples for two digital rights applicable to [2]
usage of digital technology.
Ans Digital Rights: The right and freedom to use all types of digital technology in an
acceptable and appropriate manner as well as the right to privacy and the
freedom of personal expression while using any digital media.
Examples: (Any two)
Right of privacy for personal data existing with private organisations.
Right to access the Internet without tampering upon speed or bandwidth.
Right to un-tweaked information on news channels and social media.
Right to any kind of access to content on the web.
Right to downloads or uploads.
Right to unrestricted communication methods (email, chat, IM, etc.).
OR
Any other 2 correct examples of digital rights
(1 Mark for writing the correct explanation for Digital Rights)
(½ Mark for writing each correct example of a digital right)
(f) Suggest techniques which can be adopted to impart Computer Education for: [2]
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #15/16]
(i) Visually impaired students (someone who cannot write).
(ii) Speech impaired students (someone who cannot speak).
Ans (i) For visually impaired or blind users, programs like JAWS read any text out
loud. Screen-magnification programs assist partially sighted computer users.
Braille keyboards or pointers attached to the mouth, finger, head or knee
can also be used.
(ii) Software such as speech synthesizer enables non-verbal persons to convey
virtually any thought in their minds by providing them an 'artificial voice'.
(1 mark for writing correct suggestion for visually impaired students )
(1 mark for writing correct suggestion for speech impaired students )
[Sub Code: 083 Series: HMJ/C Paper Code: 91/C] [Page #16/16]