QP 083 Computer Science New
QP 083 Computer Science New
QP 083 Computer Science New
Code No. 91
Roll No.
Candidates must write the Code on the
title page of the answer-book.
NOTE :
(i) Please check that this question paper contains 13 printed pages.
(ii) Code number given on the right hand side of the question paper should be
written on the title page of the answer-book by the candidate.
(iii) Please write down the serial number of the question in the answer-book before
attempting it.
(iv) 15 minute time has been allotted to read this question paper. The question paper
will be distributed at 10.15 a.m. From 10.15 a.m. to 10.30 a.m., the students
will read the question paper only and will not write any answer on the
answer-book during this period.
91 Page 1 P.T.O.
General Instructions :
(i) This question paper contains two parts Part A and B. Each part is compulsory.
(ii) Both Part A and Part B have choices.
(iii) Part A has two sections :
a. Section I is short answer questions, to be answered in one word or one line.
b. Section II has two case study-based questions. Each case study has
5 case-based subparts. An examinee is to attempt any 4 out of the 5 subparts.
(iv) Part B is Descriptive Paper.
(v) 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.
(vi) 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 questions no. 1 to 21.
3. Identify the statement(s) from the following options which will raise TypeError
exception(s) : 1
(A) print('5' * 3)
(B) print( 5 * 3)
(C) print('5' + 3)
(D) print('5' + '3')
91 Page 2
4. Identify the valid relational operator(s) in Python from the following : 1
(A) =
(B) <
(C) <>
(D) not
6. Write a single line statement in Python to assign the values 'BLUE', 'GREEN', 'RED'
to a tuple named Colours. 1
8. Write the name of the built-in function/method of the math module which when
executed upon 5.8 as parameter, would return the nearest smaller integer 5. 1
9. In context of Communication Networks, which of the following is the correct expansion for
the abbreviation PAN : 1
(A) Prime Area Network
(B) Post Application Network
(C) Picture Application Network
(D) Personal Area Network
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 a
table. 1
12. Which of the following clauses in SQL is most appropriate to use to select matching tuples
in a specific range of values ? 1
(A) IN
(B) LIKE
(C) BETWEEN
(D) IS
91 Page 3 P.T.O.
13. Which of the following is not a valid datatype in SQL ? 1
(A) DATE
(B) STRING
(C) DECIMAL
(D) CHAR
15. Which of the following wireless transmission media is best suited for MAN ? 1
(A) Microwave
(B) Radio Link
(C) Infrared
(D) Bluetooth
17. What shall be the ouput for the execution of the following Python Code ? 1
Cities = ['Delhi', 'Mumbai']
Cities[0], Cities[1] = Cities[1], Cities[0]
print(Cities)
18. Which of the following commands in SQL is used to add a new record into a table ? 1
(A) ADD
(B) INSERT
(C) UPDATE
(D) NEW
19. Which of the following is the correct expansion of DML in context of SQL ? 1
(A) Direct Machine Language
(B) Data Mixing Language
(C) Distributed Machine Language
(D) Data Manipulation Language
91 Page 4
20. Which of the following statements correctly explains the term Firewall in context of
Computer Network Society ? 1
(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) Stea it as his/her own work.
21. Which of the following protocols allows the use of HTML on the World Wide Web ? 1
(A) HTTP
(B) PPP
(C) FTP
(D) POP
Section II
Both the case study-based questions are compulsory. Attempt any 4 sub-parts from each question.
Each question carries 1 mark.
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
91 Page 5 P.T.O.
(c) Anmol has received a new medicine to be added into his stock, but for which
he does not know the number of UNITS. So he decides to add the medicine
without its value for UNITS. The rest of the values are as follows :
91 Page 6
(a) Name the module she will import in Line 1. 1
(b) In which mode will she open the file to add data into the file in Line 2 ? 1
(c) In which mode will she open the file to read the data from the file in Line 3 ? 1
(d) File in the blank in Line 4 to read the data from a CSV file. 1
(e) Fill in the blank in Line 5 to close the file. 1
PART B
Section I
24. Evaluate the following Python expressions : 2
(a) 2 * 3 + 4 ** 2 5 // 2
OR
(b) Differentiate between the terms Domain Name and URL in context of web
services. Also write one example of each to illustrate the difference. 2
26. Expand the following terms in context of Computer Networks : 2
(a) PPP
(b) VoIP
(c) GSM
(d) WLL
27. (a) Explain the use of positional parameters in a Python function with the help of a
suitable example. 2
OR
(b) Explain the use of a default parameter in a Python function with the help of a
suitable example. 2
28. Rewrite the following code in Python after removing all syntax error(s) : 2
Underline each correction done in the code.
Runs = ( 10, 5, 0, 2, 4, 3 )
for I in Runs:
if I=0:
print(Maiden Over)
else
print(Not Maiden)
91 Page 7 P.T.O.
29. What possible output(s) is/are expected to be displayed on the screen at the time of
execution of the program from the following code ? Also specify the maximum and
minimum value that can be assigned to the variable R when K is assigned value as 2. 2
import random
Signal = [ 'Stop', 'Wait', 'Go' ]
for K in range(2, 0, 1):
R = randrange(K)
print (Signal[R], end = ' # ')
(c) Go # Wait #
(d) Go # Stop #
30. What are Tuples in a SQL Table ? Write a suitable example with a SQL Table to
illustrate your answer. 2
31. For the following SQL Table named PASSENGERS in a database TRAVEL:
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: 2
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
91 Page 8
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
34. Write the definition of a function Sum3(L) in Python, which accepts a list L of integers
and displays the sum of all such integers from the list L which end with the digit 3. 3
then the function should display the sum of 123, 13, 23, i.e. 159 as follows :
Sum of integers ending with digit 3 = 159
35. (a) Write the definition of a function ChangeGender() in Python, which reads the
contents of a text file "BIOPIC.TXT" and displays the content of the file with
every occurrence of the word 'he' replaced by 'she'. For example, if the
content of the file "BIOPIC.TXT" is as follows : 3
Last time he went to Agra,
there was too much crowd, which he did not like.
So this time he decided to visit some hill station.
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
91 Page 9 P.T.O.
(b) Write the definition of a function Count_Line() in Python, which should read
each line of a text file "SHIVAJI.TXT" and count total number of lines present in
text file. For example, if the content of the file "SHIVAJI.TXT" is as follows : 3
36. Write the outputs of the SQL queries (i) to (iii) based on the relations CUSTOMER and
TRANSACTION given below : 3
Table : CUSTOMER
C1 RISHABH M 15000
C2 AAKASH M 12500
C3 INDIRA F 9750
C4 TUSHAR M 14600
C5 ANKITA F 22000
Table : TRANSACTION
91 Page 10
37. (a) Write the definition of a function POP_PUSH(LPop, LPush, N) in Python. The
function should Pop out the last N elements of the list LPop and Push them into
the list LPush. For example : 3
If the contents of the list LPop are [10, 15, 20, 30]
And value of N passed is 2,
then the function should create the list LPush as [30, 20]
And the list LPop should now contain [10, 15]
NOTE : If the value of N is more than the number of elements present in
LPop, then display the message "Pop not possible".
OR
(b) Write a function in Python POPSTACK(L) where L is a stack implemented by a
list of numbers. The function returns the value deleted from the stack. 3
Section III
38. A school library is connecting computers in its units in a LAN. The library has 3 units as
shown in the diagram below : 5
91 Page 11 P.T.O.
(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.
(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.
(e) The university is planni
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.
39. Write SQL statements for the following queries (i) to (v) based on the relations
CUSTOMER and TRANSACTION given below : 5
Table : CUSTOMER
C1 RISHABH M 15000
C2 AAKASH M 12500
C3 INDIRA F 9750
C4 TUSHAR M 14600
C5 ANKITA F 22000
Table : TRANSACTION
(a) To display all information about the CUSTOMERs whose NAME starts with
'A'.
(b) To display the NAME and BALANCE of Female CUSTOMERs (with GENDER as
'F') whose TRANSACTION Date (TDATE) is in the year 2019.
(c) To display the total number of CUSTOMERs for each GENDER.
(d) To display the CUSTOMER NAME and BALANCE in ascending order of GENDER.
(e) To display CUSTOMER NAME and their respective INTEREST for all
CUSTOMERs where INTEREST is calculated as 8% of BALANCE.
91 Page 12
40. (a) A binary file "PLANTS.dat" has structure (ID, NAME, PRICE).
Write the definition of a function countrec()in Python that would read contents
of the file "PATIENTS.dat" and display the details of those patients who have
the DISEASE as 'COVID-19'. The function should also display the total number
of such patients whose DISEASE is 'COVID-19'. 5
91 Page 13 P.T.O.