Iii Trial
Iii Trial
Iii Trial
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 Computers
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
(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.
♣☺☺☺☺☺♣