Ans 2021
Ans 2021
Ans 2021
Specific Instructions:
1. This question paper contains two parts- Part 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 5 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 an
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.
Ans TypeError
OR
Suraj
(A) =
(B) <
(C) <>
(D) not
(A) N=len(S)
(B) T = S
(C) 'T' in S
(D) S[0] = 'M'
8 Write the name of the built-in function / method of the math module which when 1
executed upon 5.8 as parameter, would return the nearest smaller integer 5.
Ans floor()
OR
math.floor()
10 In context of Cyber Crimes and Cyber Thefts the term IPR refers to : 1
(A) Internet Protocol Rights
(B) Inter Personnel Rights
(C) Intellectual Property Rights
(D) Individual Property Rights
11 In SQL, write the name of the aggregate function which will display the cardinality of 1
a table.
Ans count(*)
OR
count
12 Which of the following clauses in SQL is most appropriate to use to select matching 1
tuples in a specific range of values ?
(A) IN
(B) LIKE
(C) BETWEEN
(D) IS
15 Which of the following wireless transmission medium is best suited for MAN ? 1
(A) Microwave
(B) Radio Link
(C) Infrared
(D) Bluetooth
17 What shall be the output for the execution of the following Python Code ? 1
Cities = ['Delhi', 'Mumbai']
Cities[0], Cities[1] = Cities[1], Cities[0]
print(Cities)
20 Which of the following statements correctly explains the term Firewall in context of 1
Computer Network Society ?
(A) A device that protects the computer network from catching fire.
(B) A device/software that controls incoming and outgoing network traffic.
(C) Using abusive language on a social network site.
(D) Stealing someone’s text and submitting it as his/her own work.
Ans (B) A device/software that controls incoming and outgoing network traffic.
21 Which of the following protocols allows use of HTML on the World Wide Web 1
(A) HTTP
(B) PPP
(C) FTP
(D) POP
22 Anmol maintains that database of Medicines for his pharmacy using SQL to store the
data. The structure of the table PHARMA for the purpose is as follows:
● Name of the table - PHARMA
● The attributes of PHARMA are as follows:
MID - numeric
MNAME – character of size 20
PRICE - numeric
UNITS – numeric
EXPIRY - date
Table: PHARMA
MID MNAME PRICE UNITS EXPIRY
M1 PARACETAMOL 12 120 2022-12-25
M2 CETRIZINE 6 125 2022-10-12
M3 METFORMIN 14 150 2022-05-23
M4 VITAMIN B-6 12 120 2022-07-01
M5 VITAMIN D3 25 150 2022-06-30
M6 TELMISARTAN 22 115 2022-02-25
Ans Degree = 5
Cardinality = 6
Ans MID
OR
MNAME
(c) Anmol has received a new medicine to be added into his stock, but for which he does 1
not know the number of UNITS. So he decides to add the medicine without its value
for UNIT. The rest of the values are as follows:
MID MNAME PRICE EXPIRY
M7 SUCRALFATE 17 2022-03-20
Write the SQL command which Anmol should execute to perform the required task.
(d) Anmol wants to change the name of the attribute UNITS to QUANTITY in the table 1
PHARMA. Which of the following commands will he use for the purpose:
(i) UPDATE
(ii) DROP TABLE
(iii) CREATE TABLE
(iv) ALTER TABLE
(e) Now Anmol wants to increase the PRICE of all medicines by 5. Which of the following 1
commands will he use for the purpose:
(i) UPDATE SET
(ii) INCREASE BY
(iii) ALTER TABLE
(iv) INSERT INTO
23 Roshni of class 12 is writing a program in Python for her project work to create a csv
file "Teachers.csv" which will contain information for every teacher’s Identification
Number, Name for some entries. She has written the following code. However she is
unable to figure out the correct statements in a few lines of the code, hence she has
left them blank. Help her to write the statements correctly for the missing parts in
the code.
(b) In which mode will she open the file to add data into the file in Line 2 ? 1
Ans a
OR
a+
OR
append
(c) In which mode will she open the file to read the data from the file in Line 3 ? 1
Ans r
OR
r+
OR
read
(d) File in the blank in Line 4 to read the data from a CSV file. 1
Ans reader
OR
Cannot interpret question
Ans close()
PART – B
Section I
(a) 2 * 3 + 4 ** 2 - 5 // 2
Ans 20
True
25 What are cookies in a web browser? Write one advantage and one disadvantage of 2
enabling cookies in a web browser.
Ans A cookie is a small piece of information that a server sends to a client. When we visit
a Web site with cookie capabilities, its server sends certain information about the
visited website to our browser, which is stored on our hard drive as a text file and is
called a cookie.
Advantage: When we visit the same website again, the browser recognises it and
makes browsing faster.
Disadvantage: The file stored as a cookie can be exploited by hackers in retrieving our
browsing habits and exploit it for their unlawful practices.
OR
Differentiate between the terms Domain Name and URL in context of web services.
Also write one example of each to illustrate the difference.
Ans
Domain Name URL (Uniform Resource Locator)
(1 Mark for writing any one valid difference between Domain Name & URL)
(½ Mark for writing the correct example of Domain Name)
(½ Mark for writing the correct example of a URL)
27 Explain the use of positional parameters in a Python function with the help of a 2
suitable example.
Ans In such parameters the values in the parameters of the function call are assigned in
the same sequence of the corresponding identifier(s) used in the parameter(s)/
argument(s) of the respective function’s definition (i.e. from left to right).
Example:
def LEqn(x,y,a):
return x+a*y
X1=int(input("X1:"))
Y1=int(input("Y1:"))
A1=int(input("A1:"))
print(LEqn(X1,A1,Y1))
(2 mark for briefly explaining the concept of positional parameter with the help
of a suitable example)
OR
(1 mark if only the definition of positional parameter is written without any
suitable example)
OR
Explain the use of a default parameter in a Python function with the help of a
suitable example.
Ans Default parameter takes the default values when no argument/value is passed during
the function call.
def FUN(A,B=2):
print('A=',A,'B=',B)
In the second call, when no value was passed for B, B takes its default value.
(2 mark for briefly explaining the concept of default parameter with the help of
a suitable example)
OR
(1 mark if only the definition of default parameter is written without any
suitable example)
Runs = ( 10, 5, 0, 2, 4, 3 )
for I in Runs:
if I=0:
print (Maiden Over)
else
print(Not Maiden)
Runs = (10, 5, 0, 2, 4, 3)
for I in Runs:
if I==0: # Correction 1
print('Maiden Over') # Correction 2
else : # Correction 3, 4
print('Not Maiden') # Correction 5
(½ mark each for any 4 correction)
(Deduct only ½ mark if the corrections are not underlined)
import random
Maximum value of R = 1
Minimum value of R = 0
OR
randrange() raises NameError
Ans A tuple in a SQL table is a row of related data which represents or describes an item
(or record). It is a horizontal subset of the Table.
TNO NAME START END
T1 RAVI KUMAR DELHI MUMBAI
T2 NISHANT JAIN DELHI KOLKATA
T3 DEEPAK PRAKASH MUMBAI PUNE
A cursor named Cur is created in Python for a connection of a host which contains
the database TRAVEL. Write the output for the execution of the following Python
statements for the above SQL Table PASSENGERS:
Cur.execute('USE TRAVEL')
Cur.execute('SELECT * FROM PASSENGERS')
Recs=Cur.fetchall()
for R in Recs:
print(R[1])
32 Write the names of any two constraints and their respective uses in SQL. 2
Ans (Any 2 from the following OR any other correct constraint name with usage)
PRIMARY KEY - Uniquely identifies each row/record in a database table.
UNIQUE - Ensures that all values in a column are different.
NOT NULL - Ensures that a column cannot have NULL value.
DEFAULT - Provides a default value for a column when none is specified.
CHECK - ensures that all the values in a column satisfies certain conditions.
33 Write the output for the execution of the following Python code: 2
def change(A):
S=0
for i in range(len(A)//2):
S+=(A[i]*2)
return S
B = [10,11,12,30,32,34,35,38,40,2]
C = Change(B)
Print('Output is',C)
Section II
The function should read the file content and display the output as follows:
Last time she went to Agra,
there was too much crowd, which she did not like.
So this time she decided to visit some hill station.
OR
def ChangeGender():
with open ('BIOPIC.TXT', 'r') as File:
Lines = File.readlines()
for L in Lines:
Words = L.split()
for W in Words:
if W == 'he' :
W = 'she'
print(W, end = ' ')
print()
The function should read the file content and display the output as follows :
Total number of lines : 3
36 Write the outputs of the SQL queries (i) to (iii) based on the relations CUSTOMER and 3
TRANSACTION given below:
Table : CUSTOMER
ACNO NAME GENDER BALANCE
C1 RISHABH M 15000
C2 AAKASH M 12500
C3 INDIRA F 9750
C4 TUSHAR M 14600
C5 ANKITA F 22000
Table : TRANSACTION
ACNO TDATE AMOUNT TYPE
C1 2020-07-21 1000 DEBIT
C5 2019-12-31 1500 CREDIT
C3 2020-01-01 2000 CREDIT
(½ Mark for writing each correct value - with or without column heading)
(½ Mark for writing each correct line of output - with or without column heading)
OR
def POP_PUSH(LPop, LPush, N) :
M = len(LPop)
if M < N :
print('Pop not possible')
else :
for I in range(N) :
P = LPop.pop(M-1-I)
LPush.append(P)
(½ mark for checking underflow and printing “Pop not possible” in case of
underflow)
(½ mark for the loop)
(1 mark for popping elements from LPop)
(1 mark for appending popped elements into LPush)
OR
OR
def POPSTACK(L):
return L.pop()
Section - III
38 A school library is connecting computers in its units in a LAN. The library has 3 units as 5
shown in the diagram below:
(a) Suggest the most suitable place (i.e. the Unit name) to install the server of this
Library with a suitable reason.
(b) Suggest an ideal layout for connecting these Units for a wired connectivity.
Ans
OR
(c) Which device will you suggest to be installed and where should it be placed to provide
Internet connectivity to all the Units.
(d) Suggest the type of the most efficient and economical wired medium for connecting
all the computers in the network.
(1 Mark for suggesting any one efficient and economical wired medium)
(e) The university is planning to connect the Library with the School Principal’s computer
which is in his office at a distance of 50 metres. Which type of network out of LAN,
MAN, or WAN will be used for the network? Justify your answer.
Ans LAN
Justification: The office is located at a distance of merely 50 metres from the
Library, which is within the geographical limits of a local area network.
Table : CUSTOMER
ACNO NAME GENDER BALANCE
C1 RISHABH M 15000
C2 AAKASH M 12500
C3 INDIRA F 9750
C4 TUSHAR M 14600
C5 ANKITA F 22000
Table : TRANSACTION
ACNO TDATE AMOUNT TYPE
C1 2020-07-21 1000 DEBIT
C5 2019-12-31 1500 CREDIT
C3 2020-01-01 2000 CREDIT
(a) To display all information about the CUSTOMERs whose NAME starts with ‘A’.
Ans SELECT * FROM CUSTOMER WHERE NAME LIKE 'A%';
(½ Mark for writing correct SELECT statement)
(½ Mark for writing correct WHERE clause)
(b) To display the NAME and BALANCE of Female CUSTOMERs (with GENDER as 'F') whose
TRANSACTION Date (TDATE) is in the year 2019.
Ans SELECT NAME, BALANCE FROM CUSTOMER C, TRANSACTION T
WHERE C.ACNO=T.ACNO
AND GENDER=’F’ AND TDATE LIKE '2019%';
OR
OR
OR
OR
OR
OR
import pickle
def WRITEREC() :
with open ('PLANTS.DAT', 'wb') as FW :
while True :
ID = input('Enter ID : ')
NAME = input('Enter NAME : ')
PRICE = input('Enter PRICE : ')
pickle.dump([ID, NAME, PRICE])
More = input('More records (Y/N) ? ')
if More in ['n', 'N'] :
break
def SHOWHIGH() :
with open ('PLANTS.DAT', 'rb') as FR :
CR = pickle.load(FR)
for R in CR:
if int(R[2]) > 500 :
print(R)