Professional Documents
Culture Documents
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
b. Section – II has two case studies questions. Each case study has 4 case-based sub-
parts. An examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper.
a. Section-I is short answer questions of 2 marks each in which two question 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
internal option.
6. All programming questions are to be answered using Python Language only
Part-A marks
Q.No.
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.
1 Find the invalid identifier from the following 1
shape-hight b. _area c. #circle d. triangle123
Ans.
shape-hight : invalid identifier
#circle : invalid identifier
a. (1, 2, 3, 4) b. (‘1’, ‘2’, ‘3’, ‘4’) c. [‘1’, ‘2’, ‘3’, ‘4’] d. None
Answer. b
6 Write a python command to create list of keys from a dictionary. 1
dict = {‘a’: ’A’, ‘b’: ’B’, ‘c’: ’C’, ‘d’: ’D’}
Ans. dict.keys()
7 What will be the output of the following code snippet? 1
init_tuple = ((1, 2),) * 7
print(len(init_tuple[3:8]))
Ans. C. 4
8 Name the built-in mathematical function / method that is used to return the largest integer 1
less than or equal to of a number.
Ans. Floor
9 Name the protocol that is used transmitting files between computers on the internet over 1
TCP/IP connections
Ans. FTP
10 Stealing one’s information such as username and password is 1
Ans. Identity theft
11 In SQL, name the clause is used to retrieve data from 2 or more tables 1
Ans. Join
12 In SQL, what is subquery? 1
Ans. A subquery is a query within another query. The outer query is called as main query,
and inner query is called subquery
13 Write any one scaler function used in SQL 1
Ans. Scalar function – UCASE(), NOW()
14 Which of the following is not a DML command? 1
SELECT b. DELETE c. INSERT d. UPDATE
Ans. SELECT
15 Name the network device to regenerate the signal over the same network before the signal 1
becomes too weak or corrupted so as to extend the length to which the signal can be
transmitted over the same network
Ans. Repeater
16 Name the function of list that removes an item from the list. 1
Ans. Remove()
17 Which of the following is the output of the below Python code? 1
str='Tech Beamers'
print (str[4:9])
a. Beame b. Beam c. Beamer d. Beamers
Ans. b. Beam
18 Write an SQL query to fetch unique values of DEPARTMENT from Worker table. 1
Ans. Select distinct DEPARTMENT from Worker
19 Write the expanded form of Wi-Fi. 1
Ans. User Datagram Protocol
20 Which clause is used in combination with the GROUP BY clause? 1
a. UNIQUE b. CHECK c. HAVING d. DEFAULT
21 Which is not a network topology? 1
BUS b. STAR c. DIMOND d. RING
Section-II
Both the Case study based questions are compulsory. Attempt any 4 sub parts from
each question. Each question carries 1 mark
22 Consider a database LOANS with the following table:
23 Pushpa writing a program to create a CSV file “item.csv” which will contain item name,
Price and quantity of some entries. He has written the following code. As a programmer,
help him to successfully execute the given task.
readFromCsv() #Line 5
Ans.
(a) Line 1 : csv
(b) Line 2 : a
(c) Line 3 : reader
(d) Line 4 : close()
(e) Line 5 :
'Note Book', 45, 100
'Text Book', 60, 150
'Ball Pen', 10, 100
'Pencil', 2, 200
Part – B
Section - I
24 if a=7 and b=4 then what will be the output. 2
a. print('a <= b is',a<=b)
b. print('a and b is',a and b)
Or
Ans. When you assign a value to the parameter (such as param=value) and pass to the
function (like fn(param=value)), then it turns into a keyword argument.
Or
What is scope of a variable in python and write basic scopes of variables in Python.
Ans. The program part(s) in which a particular piece of code or data value can be accessed is
known as variable scope. In python broadly scopes can either be global scope or local scope.
28 Observe the following Python code very carefully and rewrite it after removing all 2
syntactical errors with each correction underlined. (2)
DEF execmain():
x = input("Enter a number:")
if (abs(x)= x):
print("You entered a positive number")
else:
x=*-1
print ("Number made positive:" x)
execmain()
Ans.
def execmain():
x = input("Enter a number:")
if (abs(x)== x):
print("You entered a positive number")
else:
x*=-1
print ("Number made positive:" ,x)
execmain()
29 Study the following program and select the possible output(s) from options (i) to (iv) 2
following it. Also, write the maximum and the minimum values that can be assigned to
variable Y. (2)
import random
X= random.random()
Y= random.randint(0,4)
print(int(X),":",Y+int(X))
(i) 0 : 0 (ii) 1 : 6 (iii) 2 : 4 (iv) 0 : 3
Ans. (i) and (iv) are the possible outputs. Minimum value that can be assigned is Y = 0.
Maximum value that can be assigned is Y = 3.
30 Define the following terms: Field, Record, Table. 2
Ans.
Field: A field is the smallest unit of a table which is also known as a column. Columns are
called attributes in a table. For example, Employee Name, Employee ID, etc.
Record: A record is a collection of values/fields of a specific entity. For example, record of
an employee
that consists of Employee name, Salary, etc.
Table: A table is called a relation. It is a collection of records of a specific type of data. For
example,
employee table, salary table, etc., that can consist of the records of employees and records of
salary
respectively.
31 What are the basic steps to connect with MySQL using table Members? 2
Ans. import MySQLdb
conn = MySQLdb . connect (host= ' host ', user= ' user ', passwd= ' passwd ', db= ' db ')
cursor = conn. cursor ()
cursor. execute (' SELECT COUNT (MemberID) as count FROM Members WHERE id= 1')
row = cursor . fetchone ()
conn . close ()
print (row )
32 What do you understand by Data Redundancy and Data Consistency? 2
Ans.
Data Redundancy:
Data redundancy is a condition created within a database or data storage technology in which
the same piece of data is held in two separate places.A DBMS eliminates data redundancy
(duplication of data) by integrating the files so that multiple copies of the same data are not
stored.
Data Consistency: A DBMS provides data consistency to a larger extent as the changes made
at one place are reflected at all other places or to all the users.
33 Write the output of the following code when executed 2
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")
Section- II
34 Write the definition of a function Reverse(X) in Python, to display the elements in reverse 3
order such that each displayed element is the twice of the original element (element * 2) of
the List X in the following manner:
Example:
If List X = [4,8,7,5,6,2,10]
After executing the function, the array content should be displayed as follows:
20 4 12 10 14 16 8
Ans.
def Reverse(X):
for i in range(len(X)-1, -1, -1):
print(X[i]*2, end=" ")
35 Write a user defined function in python that displays the number of lines starting with 'H' in 3
the file para.txt.
Ans.
def count_H():
f = open (“para.txt” , “r” )
lines =0
L=f.readlines ()
for i in L:
if i [0]== ‘H’:
lines +=1
print (“No. of lines are: “ , lines)
OR
write a function countmy() in python to read the text file "DATA.TXT" and count the
number of times "my" occurs in the file.
36 Consider the tables EMPLOYEE and SALGRADE given below and answer (a) and (C) parts 3
of this question.
To display the details of all EMPLOYEEs in descending order of DOJ.
To display NAME and DESIG of those EMPLOYEES whose SALGRADE is either S02 or
S03.
To display the content of the entire EMPLOYEES table, whose DOJ is in between '09-Feb-
2006' and '08-Aug-2009'.
Ans.
select * from EMPLOYEE order by DOJ desc;
select NAME, DESIG from EMPLOYEE where SGRADE=’S02’ OR SGRADE=’S03’;
select* from EMPLOYEE where DOJ between '09-Feb-2006' and '08-Aug-2009';
37 Write PushOn(Book) and Pop(Book) methods/functions in Python to add a new Book and 3
delete a Book from a list of Book titles, considering them to act as push and pop operations
of the Stack data structure.
Ans.
Def PushOn(Book):
a=input(“enter book title :”)
Book.append(a)
Def Pop(Book):
If (Book==[]):
print(“Stack empty”)
Else:
print(“Deleted element :”)
Book.pop()
OR
Write InsertQ(Customer) and DeleteQ(Customer) methods/functions in Python to add a new
Customer and delete a Customer from a list of Customer names, considering them to act as
insert and delete operations of the Queue
Ans.
def InsertQ(queue):
a=input(“Enter customer name :”)
queue.append(a)
def DeleteQ(queue):
if (queue==[]):
print (“Queue is empty…..”)
else:
print(“Deleted element is”, queue[0])
del queue[0]
Section-III
38 Rovenza Communications International (RCI) is an online corporate training provider 5
company for IT related courses. The company is setting up their new compus in Kolkata.
You as a network expert have to study the physical locations of various blocks and the
number of computers to be installed. In the planning phase, provide the best possible
answers for the queries (a) to (e) raised by them.
a. Suggest the most appropriate block, where RCI should plan to install the server.
b. Suggest the most appropriate block to block cable layout to connect all three blocks for
efficient communication.
c. Which type of network out of the following is formed by connecting the computers of
these three blocks?
LAN
MAN
WAN
d. Which wireless channel out of the following should be opted by RCI to connect to
students from all over the world?
Infrared
Microwave
Satellite
e. Suggest the placement of a switch/Hub in the network with justification.
Ans.
a. Faculty Recording Block.
b. Star topology
c. LAN
d. Satellite connection
e. Every block has more then one computer so switch/hub is required in every block.
39 Consider the following tables Sender and Recipient. Write SQL commands for the 5
statements (a) to (c) and give the outputs for SQL queries (d) to (e).
Sender
SenderID SenderName SenderAddress Sendercity
ND01 R Jain 2, ABC Appls New Delhi
MU02 H Sinha 12 Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-K,SDA New Delhi
Recipients
RecID SenderID RecName RecAddress recCity
KO05 ND01 R Bajpayee 5, Central Avenue Kolkata
ND08 MU02 S Mahajan 116, A-Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, C S Terminals Mumbai
ND48 ND50 S Tripathi 13, BI D Mayur Vihar New delhi
ANs.
a. Select R.RecIC, S.Sendername, S.SenderAddress, R.RecName, R.RecAddress from
Sender S, Recepient R where S.SenderID=R.SenderID ;
b. SELECT * from Recipent ORDER By RecName;
c. SELECT COUNT( *) from Recipient Group By RecCity;
d.
A.SenderName B.RecName
R Jain H Singh
S Jha P K Swamy
e.
RecName RecAddress
S Mahajan 116, A Vihar
S Tripathi 13, BID, Mayur Vihar
Or
Write a program to read a record from the binary file “student.dat”