Iii Trial

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

a) The statement x = x + 10 is a valid statement

b) List slice is a list itself.


c) Lists are immutable while strings are mutable.
d) Lists and strings in pythons support two way indexing.
5. What will be the output of following code snippet: 1
msg = “Hello Friends”
msg [ : : -1]
a) Hello b) Hello Friend c) 'sdneirF olleH' d) Friend
6. Which of the following function is used to write data in binary mode? 1
a) write ( ) b) output ( ) c) dump ( ) d) send ( )
7. Suppose a tuple T1 is declared as 1
T1 = (10, 20, 30, 40, 50)
which of the following is incorrect?
a) print(T[1]) b) T[2] = -29 c) print(max(T)) d) print(len(T))

8. What will be output of following: 1


d = {1 : “SUM”, 2 : “DIFF”, 3 : “PROD”}
for i in d:
print (i)
a) 1 b) SUM c) 1 d) 3
2 DIFF SUM SUM
3 PROD 2 3
DIFF DIFF
3 3
PROD PROD
9. What will be output of following code: 1
X = 50
def funct(X):
X=2
funct (X)
print(„X is now: „, X)
a) X is now: 50 b) X is now: 2 c) Error d) None of the above
10. To read the next line from the file object fob, we can use: 1
a) fob.read(2) b) fob.read( ) c) fob.readline( ) d) fob.readlines( )
11. TCP/IP stands for 1
a) Transmission Communication Protocol / Internet Protocol
b) Transmission Control Protocol / Internet Protocol
c) Transport Control Protocol / Interwork Protocol
d) Transport Control Protocol / Internet Protocol
12. An attack that encrypts files in a computer and only gets decrypted after 1
paying money to the attacker..
a) Botnet b) Trojan c) Ransomware d) Spam
13. Which is known as range operator in MySQL. 1
a) IN b) BETWEEN c) IS d) DISTINCT
14. If column “salary” of table “EMP” contains the dataset {10000, 15000, 25000, 1
10000, 25000}, what will be the output of following SQL statement?
SELECT SUM(DISTINCT SALARY) FROM EMP;
a) 75000 b) 25000 c) 10000 d) 50000
15. Which of the following functions is used to find the largest value from the given 1
data in MySQL?
a) MAX ( ) b) MAXIMUM ( ) c) LARGEST ( ) d) BIG ( )
16. Name the clause used in query to place the condition on groups in MySQL? 1
17. Write the name of topology in which all the nodes are connected through a 1
single Coaxial cable?
18. Write SQL statement to find total number of records in table EMP? 1
19. Write full form of VoIP. 1
20. Write command to list the available databases in MySQL. 1
21. Expand the term DHCP. 1
SECTION – II
Both the Case study based questions are compulsory. Attempt any 4 sub parts from
each question. Each question carries 1 mark
22. An organization SoftSolutions is considering to maintain their employees
records using SQL to store the data. As a database administer, Murthy has
decided that :
• Name of the database - DATASOFT
• Name of the table - HRDATA
• The attributes of HRDATA are as follows:
ECode – Numeric
EName – character of size 30
Desig – Character of size 15
Remn – numeric
Table: HRDATA
ECode EName Desig Remn
80001 Lokesh Programmer 50000
80004 Aradhana Manager 65000
80007 Jeevan Programmer 45000
80008 Arjun Admin 55000
80012 Priya Executive 35000
a) Identify the attribute best suitable to be declared as a primary key. 1
b) Write the degree and cardinality of the table HRDATA, 1
c) Write command to insert following data in the table: 1
ECode = 80015, Ename = “Allen” Remn = 43000
d) Write SQL statement to delete the record of Jeevan from the table HRDATA. 1
e) Write SQL statement to increase the Remn of all the employees by 10 1
percent.
23. MOHIT of class 12 is writing a program to search a name in a CSV file
“MYFILE.csv”. He has written the following code. As a programmer, help him to
successfully execute the given task.
import _________ # Statement 1
f = open("MYFILE.csv", _______) # Statement 2
data = ____________ ( f ) # Statement 3
nm = input("Enter name to be searched: ")
for rec in data:
if rec[0] == nm:
print (rec)
f.________( ) # Statement 4
(a) Name the module he should import in Statement 1. 1
(b) In which mode, MOHIT should open the file to search the data in the file in 1
statement 2?
(c) Fill in the blank in Statement 3 to read the data from the file. 1
(d) Fill in the blank in Statement 4 to close the file. 1
(e) Write the full form of CSV. 1
PART – B
SECTION – I
24. Evaluate following expressions: 2
a) 18 % 4 ** 3 // 7 + 9 b) 2 > 5 or 5 == 5 and not 12 <= 9
25. Write two characteristics of Wi-Fi. 2
OR
Write two advantages of using an optical fibre cable over an Ethernet cable.
26. Expand the following terms: 2
a) GSM b) POP c) JSP d) CDMA
27. What is a module in Python? Define any two functions of Math module in 2
python.
OR
Differentiate between Positional Argument and Default Argument of function in
python with suitable example
28. Rewrite the following code in Python after removing all syntax error(s). 2
Underline each correction done in the code.
Num = int(input("Number:")
s=0
for i in range(1,Num,3)
s+=1
if i%2=0:
print(i*2)
Else
print(i*3)
print (s)
29. What possible outputs(s) are expected to be displayed on screen at the time of 2
execution of the program from the following code? Also specify the minimum
and maximum values that can be assigned to the variable End .
import random
Colours = ["VIOLET","INDIGO","BLUE","GREEN", "YELLOW","ORANGE","RED"]
End = randrange(2)+3
Begin = randrange(End)+1
for i in range(Begin,End):
print(Colours[i],end="&")
(i) INDIGO&BLUE&GREEN& (ii) VIOLET&INDIGO&BLUE&
(iii) BLUE&GREEN&YELLOW& (iv) GREEN&YELLOW&ORANGE&

30. Differentiate between an Attribute and a Tuple in a Relational Database with 2


suitable example.
31. Differentiate between fetchone( ) and fetchall( ) function. 2
32. Explain any two aggregate function of SQL with suitable example. 2
33. Write the output of following python code 2
Text="Welcome Python"
L=len(Text)
ntext=""
for i in range (0,L):
if Text[i].isupper():
ntext=ntext+Text[i].lower()
elif Text[i].isalpha():
ntext=ntext+Text[i].upper()
else:
ntext=ntext+"!!"
print (ntext)

SECTION – II
34. Write a function in REP which accepts a list of integers and its size as 3
arguments and replaces elements having even values with its half and elements
having odd values with twice its value .
eg: if the list contains
3, 4, 5, 16, 9
then the function should rearranged list as
6, 2,10,8, 18
35. Write a method in python to read lines from a text file DIARY.TXT and display 3
those lines which start with the alphabets P.
OR
Write a function countmy( ) in python to read the text file "mystory.txt" and count
the number of times "my" occurs in the file. For example if the file mystory.txt
contains:
"This is my school. I love to play and study in my school."
the countmy( ) function should display the output as:"my occurs 2 times".
36. Consider the following tables: COMPANY and MODEL. 3
Write the outputs of the SQL queries (a) to (c) based on the relations
COMPANY and MODEL given below:
Table: COMPANY
CompID CompName CompHQ Contact
Person
1 Titan Okhla C.B. Ajit
2 Ajanta Najafgarh R. Mehta
3 Maxima Shahdara B. Kohli
4 Seiko Okhla R. Chadha
5 Ricoh Shahdara J. Kishore

Table: MODEL
Model_ID Comp_ID Cost DateOfManufacture
T020 1 2000 2010-05-12
M032 4 7000 2009-04-15
M059 2 800 2009-09-23
A167 3 1200 2011-01-12
T024 1 `1300 2009-10-14
a) Select COUNT(DISTINCT CompHO) from Company;
b) Select CompName, „Mr.‟, ContactPerson
from Company where CompName like „%a‟;
c) select Model_ID, Comp_ID, Cost, CompName, ContactPerson
from Model, Company
where Model.Comp_ID = Company.Comp_ID
and Comp_ID > 2;
37. Write a function DELQ(Customer) in Python to delete a Customer from a Queue 3
implemented using list.
OR
Write a function POP(Book) in Python to delete a Book from a list of Book titles,
considering it to act as a pop operation of the Stack data structure.
SECTION - III
38. ABC CONSULTANTS is a professional consultancy company. The company is
planning to set up new offices in India with its hub at Gurugram. As a network
adviser, you have to understand their requirements and suggest to them the
best available solutions.

Block-to-Block distance (in Mtrs.):

Block (From) Block (To) Distance

Human Resources Conference 60

Human Resources Finance 60

Conference Finance 120

Expected Number of Computers to be installed in each block:

Block Computers

Human Resources 125

Conference 25

Finance 60

(a) What will be the most appropriate block where organization should plan to 1
install their server?
(b) Draw a block-to-block cable layout to connect all the buildings in the most 1
appropriate manner for efficient communication.
(c) What will be the best possible connectivity out of the following to connect 1
the new set-up of offices in Dehradun with its London base office?
(i) Infrared (ii) Satellite Link (iii) Ethernet Cable
(d) Which of the following devices will you suggest to connect each computer 1
in each of the above buildings?
(i) Gateway (ii) Switch (iii) Modem
(e) Write names of any two popular Open Source Software which are used as 1
Operating Systems.
39. Write SQL commands for (i) to (v) on the basis of relations given below:
Table: BOOKS
book_id Book_name author_name Publishers Price Type qty
L01 Let us C Sanjay EPB 450 Comp 15
Mukharjee
L02 Genuine J. Mukhi FIRST 755 Fiction 24
PUBL.
L04 Mastering Kantkar EPB 165 Comp 60
C++
L03 VC++ P. Purohit TDH 250 Comp 45
advance
L05 Programming Sanjeev FIRST 350 Fiction 30
with Python PUBL.

Table: ISSUED
Book_ID Qty_Issued
L02 13
L04 5
L05 21

(i) To show the books of FIRST PUBL. Publishers written by P. Purohit. 1

(ii) To display cost of all the books published for EPB. 1

(iii) Depreciate the price of all books of EPB publishers by 5%. 1

(iv) To display the BOOK_NAME and price of the books, more than 5 copies of 1
which have been issued.
(v) To show total cost of books of each type. 1
40. Write a python program to append a new records in a binary file –“student.dat”. 5
The record can have Rollno, Name and Marks.

OR

Write a python program to search and display the record of the student from a
binary file “Student.dat” containing students records (Rollno, Name and Marks).
Roll number of the student to be searched will be entered by the user.

♣☺☺☺☺☺♣

You might also like