Autumn XII A
Autumn XII A
a. 20,6 b. 6,20
c. 9,6 d. 6,9
[1]
4 Select the correct output of the code: 1
Options:
a. PYTHON-IS-Fun
b. PYTHON-is-Fun
c. Python-is-fun
d. PYTHON-Is -Fun
5 In MYSQL database, if a table, Alpha has degree 5 and cardinality 3, and 1
another table, Beta has degree 3 and cardinality 5, what will be the degree
and cardinality of the Cartesian product of Alpha and Beta?
a. 5,3 b. 8,15
c. 3,5 d. 15,8
6 Riya wants to transfer pictures from her mobile phone to her laptop. She uses 1
Bluetooth Technology to connect two devices. Which type of network will be
formed in this case?
a. PAN b. LAN
c. MAN d. WAN
7 Which of the following will delete key-value pair for key = “Red” from a 1
dictionary D1?
a. delete D1("Red")
b. del D1["Red"]
c. del.D1["Red"]
d. D1.del["Red"]
[2]
8 Consider the statements given below and then choose the correct output from 1
the given options:
Options:
a. ndsr
b. ceieP0
c. ceieP
d. yndsr
Options:
a. Statement 1
b. Statement 2
c. Statement 3
d. Statement 4
[3]
10 What possible outputs(s) will be obtained when the following code is 1
executed?
Options:
a.
RED*
WHITE*
BLACK*
b.
WHITE*
BLACK*
c.
WHITE* WHITE*
BLACK* BLACK*
d.
YELLOW*
WHITE*WHITE*
BLACK* BLACK* BLACK*
[4]
11 Fill in the blank: 1
The modem at the sender’s computer end acts as a ____________. a.
Model
b. Modulator
c. Demodulator
d. Convertor
12 Consider the code given below: 1
Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 110?
Options:
a. global a
b. global b=100
c. global b
d. global a=100
13 State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically correct.
[5]
14 Which of the following statements is FALSE about keys in a relational 1
database?
16 Which of the following functions changes the position of file pointer and 1
returns its new position?
a. flush()
b. tell()
c. seek()
d. offset()
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the
correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False
(d) A is false but R is True
17 Assertion(A): List is an immutable data type 1
Reasoning(R): When an attempt is made to update the value of an immutable
variable, the old variable is destroyed and a new variable is created by the
same name in memory.
SECTION B
[6]
19 (i) Expand the following terms: 1+1=
2
POP3 , URL
(ii) Give one difference between XML and HTML.
OR
(i) Define the term bandwidth with respect to networks.
(ii) How is http different from https?
20 The code given below accepts a number as an argument and returns the reverse 2
number. Observe the following code carefully and rewrite it after removing all
syntax and logical errors. Underline all the corrections made.
[7]
21 Write a function countNow(PLACES) in Python, that takes the 2
dictionary, PLACES as an argument and displays the names (in
uppercase)of the places whose names are longer than 5 characters. For
example, Consider the following dictionary
PLACES={1:"Delhi",2:"London",3:"Paris",4:"New
York",5:"Doha"}
The output should be:
LONDON
NEW YORK
OR
Write a function, lenWords(STRING), that takes a string as an argument
and returns a tuple containing length of each word of a string.
For example, if the string is "Come let us have some fun", the tuple
will have (4, 3, 2, 4, 4, 3)
22 Predict the output of the following code: 2
[8]
23 Write the Python statement for each of the following tasks using BUILT-IN 1+1=
2
functions/methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop /
period or not.
OR
A list named studentAge stores age of students of a class. Write the Python
command to import the required module and (using built-in function) to
display the most common age value from the given list.
[9]
24 Ms. Shalini has just created a table named “Employee” containing 2
Thereafter, write the command to insert the following record in the table:
EmpId- 999
Ename- Shweta
Department: Production
Salary: 26900
OR
[10]
SECTION C
26 Predict the output of the Python code given below: 3
27 Consider the table CLUB given below and write the output of the SQL queries 1*3=
3
that follow.
[11]
4687 SHYAM 37 MALE CRICKET 1300 2004-
04-15
1245 MEENA 23 FEMALE VOLLEYBALL 1000 2007-
06-18
1622 AMRIT 28 MALE KARATE 1000 2007-
09-05
1256 AMINA 36 FEMALE CHESS 1100 2003-
08-15
1720 MANJU 33 FEMALE KARATE 1250 2004-
04-10
2321 VIRAT 35 MALE CRICKET 1050 2005-
04-30
OR
Write a function, vowelCount() in Python that counts and displays the
number of vowels in the text file named Poem.txt.
29 Consider the table Personal given below: 1*3=
3
Table: Personal
P_ID Name Desig Salary Allowance
[12]
P01 Rohit Manager 89000 4800
P02 Kashish Clerk NULL 1600
P03 Mahesh Superviser 48000 NULL
Based on the given table, write SQL queries for the following:
(i) Increase the salary by 5% of personals whose allowance
(ii) Display Name and Total Salary (sum of Salary and Allo all is
personals. The column heading ‘Total Salary’ should known.
displayed. wance) of
also be an
(iii) Delete the record of personals who have salary greater th 25000
[13]
30 A list, NList contains following record as list elements: te the 3
[City, Country, distance from Delhi] d
Each of these records are nested together to form a nested list. Wri
following user defined functions in Python to perform the specifie
operations on the stack named travel. city and
3500 km
(i) Push_element(NList): It takes the nested list as an
argument and pushes a list object containing name of the
splays
country, which are not in India and distance is less than when
from Delhi. there
['Naypyidaw', 'Myanmar']
Stack Empty
[14]
SECTION D
31 Consider the tables PRODUCT and BRAND given be low: 1*4=
4
Table: PRODUCT
PCode PName UPrice Rating BID
P01 Shampoo 120 6 M03
P02 Toothpaste 54 8 M02
P03 Soap 25 7 M03
P04 Toothpaste 65 4 M04
P05 Soap 38 5 M05
P06 Shampoo 245 6 M05
Table: BRAND
BID BName
M02 Dant Kanti
M03 Medimix
M04 Pepsodent
M05 Dove
[15]
32 Vedansh is a Python programmer working in a school. For the Annual Sports 4
Event, he has created a csv file named Result.csv, to store the results of
students in different sports events. The structure of Result.csv is :
For efficiently maintaining data of the event, Vedansh wants to write the
following user defined functions:
Accept() – to accept a record from the user and add it to the file
Result.csv. The column headings should also be added on top of the csv
file. wonCount() – to count the number of students who have won any
event.
SECTION E
[16]
33 Meticulous EduServe is an educational organization. It is planning to setup its 1*5=
5
India campus at Chennai with its head office at Delhi. The Chennai campus
a) Suggest and draw the cable layout to efficiently connect various blocks of
buildings within the CHENNAI campus for connecting the digital devices.
[17]
b) Which network device will be used to connect computers in each block
to form a local area network?
SPORT.DAT and copies the records with Sport name as “Basket Ball” to
the file named BASKET.DAT. The function should return the total number of
records copied to the file BASKET.DAT.
OR
(i) How are text files different from binary files?
(ii) A Binary file, CINEMA.DAT has the following structure:
{MNO:[MNAME, MTYPE]}
Where
MNO – Movie Number
MNAME – Movie Name
MTYPE is Movie Type
Write a user defined function, findType(mtype), that accepts mtype as
parameter and displays all the records from the binary file
[18]
CINEMA.DAT, that have the value of Movie Type as mtype.
35 (i) Define the term Domain with respect to RDBMS. Give one example to 1+4=
support your answer. 5
[19]
(ii) Kabir wants to write a program in Python to insert the following record in
the table named Student in MYSQL database, SCHOOL:
• name(Name) - string
• Fee – float
Note the following to establish connectivity between Python and
MySQL:
• Username - root
• Password - tiger
• Host - localhost
The values of fields rno, name, DOB and fee has to be accepted from the
user. Help Kabir to write the program in Python.
OR
(i) Give one difference between alternate key and candidate key.
SCHOOL:
• rno(Roll number )- integer
• name(Name) - string
• Fee – float
Note the following to establish connectivity between Python and
MySQL:
• Username - root
[20]
• Password - tiger
• Host - localhost
[21]
Sartaj, now wants to display the records of students whose fee is more than
5000. Help Sartaj to write the program in Python.
[22]