Previous Year Paper From 2023-2019
Previous Year Paper From 2023-2019
Previous Year Paper From 2023-2019
1. (a) Differentiate between Syntax Error and Run-Time Error. Also, write
a suitable example in Python to illustrate both. 2
for C in range(1,Val,3)
Adder+=C
if C%2=0:
Print C*10
Else:
print C*
print Adder
(d) Find and write the output of the following Python code : 2
Data = ["P",20,"R",10,"S",30]
Times = 0
Alpha = ""
Add = 0
for C in range(1,6,2):
Times = Times + C
Alpha = Alpha + Data[C-1]+"$"
Add = Add + Data[C]
print Times,Add,Alpha
91 12
(e) Find and write the output of the following Python code : 3
class GRAPH:
def __init__(self,A=50,B=100):
self.P1=A
self.P2=B
def Up(self,B):
self.P2 = self.P2 B
def Down(self,B):
self.P2 = self.P2 + 2*B
def Left(self,A):
self.P1 = self.P1 A
def Right(self,A):
self.P1 = self.P1 + 2*A
def Target(self):
print "(",self.P1.":",self.P2,")"
G1=GRAPH(200,150)
G2=GRAPH()
G3=GRAPH(100)
G1.Left(10)
G2.Up(25)
G3.Down(75)
G1.Up(30)
G3.Right(15)
G1.Target()
G2.Target()
G3.Target()
91 13 P.T.O.
(f) What possible output(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 BEGIN and LAST. 2
import random
POINTS=[20,40,10,30,15];
POINTS=[30,50,20,40,45];
BEGIN=random.randint(1,3)
LAST=random.randint(2,4)
for C in range(BEGIN,LAST+1):
print POINTS[C],"#",
V1=Vehicle("BMW") #Line 7
V1.Show() #Line 8
Vehicle.Type="Bus" #Line 9
V2=Vehicle("VOLVO") #Line 10
V2.Show() #Line 11
91 14
(i) What is the difference between the variable in Line 2 and
Line 4 in the above Python code ?
Instance Attributes
- Radius,Height # Radius and Height of Container
- Type # Type of Container
- Volume # Volume of Container
Methods
- CalVolume() # To calculate volume
# as per the Type of container
# With the formula as given below :
91 15 P.T.O.
(d) Answer the questions (i) to (iv) based on the following : 4
Class Top1(object):
def __init__(self,tx): #Line 1
self.X=tx #Line 2
def ChangeX(self,tx):
self.X=self.X+tx
def ShowX(self):
print self.X
Class Top2(object):
def __init__(self,ty): #Line 3
self.Y=ty #Line 4
def ChangeY(self,ty):
self.Y=self.Y+ty
def ShowY(self):
print self.Y,
class Bottom(Top1,Top2):
def __init__(self,tz): #Line 5
self.Z=tz #Line 6
Top2.__init__(self,2*tz): #Line 7
Top1.__init__(self,3*tz): #Line 8
def ChangeZ(self,tz):
self.Z=self.Z+tz
self.ChangeY(2*tz)
self.ChangeX(3*tz)
def ShowZ(self):
print self.Z,
self.ShowY()
self.ShowX()
B=Bottom(1)
B.ChangeZ(2)
B.ShowZ()
91 16
(i) Write the type of the inheritance illustrated in the above.
(ii) Find and write the output of the above code.
(iii) What are the methods shown in Line 1, Line 3 and Line 5
known as ?
(iv) What is the difference between the statements shown in
Line 6 and Line 7 ?
(b) Write a method in Python to read lines from a text file INDIA.TXT,
to find and display the occurrence of the word ‘‘India’’. 2
For example :
If the content of the file is
91 18
SECTION C
[For all the candidates]
5. (a) Observe the following tables VIDEO and MEMBER carefully and
write the name of the RDBMS operation out of (i) SELECTION
(ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT, which
has been used to produce the output as shown below. Also, find the
Degree and Cardinality of the final result. 2
TABLE : VIDEO
VNO VNAME TYPE
F101 The Last Battle Fiction
C101 Angels and Devils Comedy
A102 Daredevils Adventure
TABLE : MEMBER
MNO MNAME
M101 Namish Gupta
M102 Sana Sheikh
M103 Lara James
91 19 P.T.O.
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries
(v) to (viii), which are based on the tables. 6
TABLE : ACCOUNT
ANO ANAME ADDRESS
101 Nirja Singh Bangalore
102 Rohan Gupta Chennai
103 Ali Reza Hyderabad
104 Rishabh Jain Chennai
105 Simran Kaur Chandigarh
TABLE : TRANSACT
TRNO ANO AMOUNT TYPE DOT
T001 101 2500 Withdraw 2017-12-21
T002 103 3000 Deposit 2017-06-01
T003 102 2000 Withdraw 2017-05-12
T004 103 1000 Deposit 2017-10-22
T005 101 12000 Deposit 2017-11-06
(d) Reduce the following Boolean Expression to its simplest form using
K-Map : 3
G(U,V,W,Z) = (3,5,6,7,11,12,13,15)
(b) Classify each of the following Web Scripting as Client Side Scripting
and Server Side Scripting : 2
(i) Java Scripting
(ii) ASP
(iii) VB Scripting
(iv) JSP
(c) Write the expanded names for the following abbreviated terms used
in Networking and Communications : 2
(i) SMTP
(ii) VoIP
(iii) GSM
(iv) WLL
91 21 P.T.O.
(d) CASE STUDY BASED QUESTION :
Ayurveda Training Educational Institute is setting up its centre in
Hyderabad with four specialised departments for Orthopedics,
Neurology and Pediatrics along with an administrative office in
separate buildings. The physical distances between these
department buildings and the number of computers to be installed
in these departments and administrative office are given as follows.
You, as a network expert, have to answer the queries as raised by
them in (i) to (iv).
91 22
(i) Suggest the most suitable location to install the main server
of this institution to get efficient connectivity. 1
(iv) Suggest the topology of the network and network cable for
efficiently connecting each computer installed in each of the
buildings out of the following : 1
Topologies : Bus Topology, Star Topology
Network Cable : Single Pair Telephone Cable, Coaxial Cable,
Ethernet Cable
91 23 00
P.T.O.
SECTION B
[Only for candidates, who opted for Python]
1. (a) Write the names of any four data types available in Python. 2
(c) Rewrite the following code in python after removing all syntax
error(s). Underline each correction done in the code. 2
250 = Number
WHILE Number<=1000:
if Number=>750:
print Number
Number=Number+100
else
print Number*2
Number=Number+50
(d) Find and write the output of the following python code : 2
Msg1="WeLcOME"
Msg2="GUeSTs"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print Msg3
91 14
(e) Find and write the output of the following python code : 3
def Changer(P,Q=10):
P=P/Q
Q=P%Q
print P,"#",Q
return P
A=200
B=20
A=Changer(A,B)
print A,"$",B
B=Changer(B)
print A,"$",B
A=Changer(A)
print A,"$",B
import random
VALUES=[10,20,30,40,50,60,70,80]
BEGIN=random.randint(1,3)
LAST=random.randint(BEGIN,4)
for I in range(BEGIN,LAST+1):
print VALUES[I],"-",
(i) 30 - 40 - 50 - (ii) 10 - 20 - 30 - 40 -
(iii) 30 - 40 - 50 - 60 - (iv) 30 - 40 - 50 - 60 - 70 -
91 15 P.T.O.
2. (a) Write four features of object oriented programming. 2
OR
91 16
(i) What are the methods/functions mentioned in Line 2 and
Line 7 specifically known as ?
(ii) Mention the line number of the statement, which will call
and execute the method/function shown in Line 2. 2
Instance Attributes
- Hno # House Number
- Nor # Number of Rooms
- Type # Type of the House
Methods/function
- AssignType() # To assign Type of House
# based on Number of Rooms as follows :
Nor Type
<=2 LIG
==3 MIG
>3 HIG
91 17 P.T.O.
(d) Answer the questions (i) to (iii) based on the following :
class Furniture(object): #Line 1
def __init__(self,Q): #Line 2
self.Qty = Q
def GetMore(self,TQ): #Line 3
self.Qty =self.Qty+TQ
def FRDisp(self): #Line 4
print self.Qty
91 18
(i) Write the type of the inheritance illustrated in the above. 1
(ii) Find and write the output of the above code. 2
(iii) What is the difference between the statements shown in
Line 11 and Line 12 ? 1
OR
OR
OR
OR
For example :
If the content of the file is
OR
91 21 P.T.O.
For example :
If the content of the file is
91 22
SECTION C
[For all candidates]
5. Write SQL queries for (i) to (iv) and write outputs for SQL queries (v) to
(viii), which are based on the table given below : 8
Table : TRAINS
TNO TNAME START END
11096 Ahimsa Express Pune Junction Ahmedabad Junction
12015 Ajmer Shatabdi New Delhi Ajmer Junction
1651 Pune Hbj Special Pune Junction Habibganj
13005 Amritsar Mail Howrah Junction Amritsar Junction
12002 Bhopal Shatabdi New Delhi Habibganj
12417 Prayag Raj Express Allahabad Junction New Delhi
14673 Shaheed Express Jaynagar Amritsar Junction
12314 Sealdah Rajdhani New Delhi Sealdah
12498 Shane Punjab Amritsar Junction New Delhi
12451 Shram Shakti Express Kanpur Central New Delhi
12030 Swarna Shatabdi Amritsar Junction New Delhi
Table : PASSENGERS
PNR TNO PNAME GENDER AGE TRAVELDATE
P001 13005 R N AGRAWAL MALE 45 2018-12-25
P002 12015 P TIWARY MALE 28 2018-11-10
P003 12015 S TIWARY FEMALE 22 2018-11-10
P004 12030 S K SAXENA MALE 42 2018-10-12
P005 12030 S SAXENA FEMALE 35 2018-10-12
P006 12030 P SAXENA FEMALE 12 2018-10-12
P007 13005 N S SINGH MALE 52 2018-05-09
P008 12030 J K SHARMA MALE 65 2018-05-09
P009 12030 R SHARMA FEMALE 58 2018-05-09
6. (a) State any one Distributive Law of Boolean Algebra and verify it
using truth table. 2
(d) Reduce the following Boolean Expression to its simplest form using
K-Map : 3
F(P,Q,R,S) = (0,1,2,3,5,6,7,10,14,15)
91 24
7. (a) Damodar Mohan has been informed that there had been a backdoor
entry to his computer, which has provided access to his system
through a malicious user/programs, allowing confidential and
personal information to be subjected to theft. It happened because
he clicked a link provided in one of the pop-ups from a website
announcing him to be winner of prizes worth 1 Million Dollars.
Which of the following has caused this out of the following ?
(i) Virus
(ii) Worm
(iii) Trojan Horse
Also, mention, what he should do to prevent this infection. 2
(d) Write the expanded names for the following abbreviated terms used
in Networking and Communications : 2
(i) MBPS
(ii) WAN
(iii) CDMA
(iv) WLL
91 25 P.T.O.
(e) Jonathan and Jonathan Training Institute is planning to set up its
centre in Amritsar with four specialised blocks for Medicine,
Management, Law courses alongwith an Admission block in
separate buildings. The physical distances between these blocks and
the number of computers to be installed in these blocks are given
below. You as a network expert have to answer the queries as raised
by their board of directors as given in (i) to (iv).
91 26
(i) Suggest the most suitable location to install the main server
of this institution to get efficient connectivity. 1
91 27 P.T.O.