answer key for hf
answer key for hf
SECTION A 18*1=18
1. b) \\\
2. b) MENE
3. 42
4. ext#nex
5.Alter
6. b) ("","MA","LAYALAM")
7. c) None
8. puC dlroW
9. c. Error
10. Observe the following code carefully and rewrite it after removing all syntactical errors. Underline all the
corrections made.
12. 30 60
10
13. where
16. 70
17. (b) Both (A) and (R) are true and (R) is not the correct explanation for (A).
18. (a) Both (A) and (R) are true and (R) is the correct explanation for (A).
SECTION B 7*2=14
XML HTML
The full form is eXtensible Markup Language The full form is Hypertext Markup Language
The main purpose is to focus on the transport Focusses on the appearance of data.
of data and saving the data Enhances the appearance of text
XML is dynamic because it is used in the HTML is static because its main function is in
transport of data the display of data
21. 39 14
24 25
22. DEL@COL@BEI
25. 6$30
SECTION C 5*3=15
27. Consider the table Stationery given below and write the output of the SQL queries that follow.
Distributor Sum(qty)
Reliable stationers 100
classic Plastics 400
Clear Deals 410
(ii) SELECT ITEMNO, ITEM FROM STATIONERY WHERE DISTRIBUTOR = "Classic Plastics" AND PRICE > 10;
ItemNo Item
402 Gel pen premium
406 Gel pen classic
(iii) SELCET ITEM, QTY * PRICE AS "AMOUNT" FROM STATIONERY WHERE ITEMNO = 402;
Item Amount
Gel pen premium 3000
28. Write a method/function DISPLAYLINES() in Python to read lines from a text file CONTENT.TXT, and display those
lines, which have @ anywhere in the line.
Based on the given table, write SQL queries for the following :
SECTION D 2*4=8
31. Consider the tables GAMES and PLAYERS given below :
(i) Display the game type and average number of games played in each type.
select type,avg(number) from games groupby type;
(ii) Display prize money, name of the game, and name of the players from the tables Games and Players.
select prizemoney,gamename,name from games g,player p whereg.gcode=p.gcode;
(iii) Display the types of games without repetition.
select distinct type from games;
(iv) Display the name of the game and prize money of those games whose prize money is known.
select gamename,prizemoney from games where prizemoney is not null;
32. Mr. Mahesh is a Python Programmer working in a school. He has to maintain the records of the sports students.
He has created a csv file named sports.csv, to store the details. The structure of sports.csv is : [sport_id, competition,
prize_won] where
Add_detail(): to accept the detail of a student and add to a csv file, "sports.csv".
Count_Medal(): to display the name of competitions in which students have won "Gold" medal. Help him in writing
the code of both the functions.
SECTION E 3*5=15
33. Logistic Technologies Ltd. is a Delhi based organization which is expanding its office set-up to Ambala. At Ambala
office campus, they are planning to have 3 different blocks for HR, Accounts and Logistics related work. Each block
has a number of computers, which are required to be connected to a network for communication, data and resource
sharing.
As a network consultant, you have to suggest the best network related solutions for them for issues/problems raised
in (i) to (v), keeping in mind the distances between various block/locations and other given parameters.
(i) Suggest the most appropriate block/location to house the SERVER in the Ambala office. Justify your answer.
HR BLOCK
(ii) Suggest the best wired medium to efficiently connect various blocks within the Ambala office compound.
Twisted Pair Cable
(iii) Draw an ideal cable layout (Block to Block) for connecting these blocks for wired connectivity.
HR BLOCK------------------Account Block----------------Logistics Block
(iv) The company wants to schedule an online conference between the managers of Delhi and Ambala offices. Which
protocol will be used for effective voice communication over the Internet ?
VOIP
(v) Which kind of network will it be between Delhi office and Ambala office ?
WAN
34. (i) Give one difference between write() and writeline() function in text file.
The `Write` method is used to write text to the console without adding a newline character at the
end of the text. The `WriteLine` method is used to write text to the console and adds a newline
character at the end of the text, causing the next output to appear on a new line.
(ii) Consider a binary file, Cinema.dat containing information in the following structure :
Write a function, search_copy(), that reads the content from the file Cinema.dat and copies all the details of the
"Comedy" movie type to file named movie.dat.
def search_copy():
with open('cinema.dat', 'r') as source_file, open('movie.dat', 'w') as dest_file:
for line in source_file:
parts = line.strip().split(', ')
if len(parts) == 3 and parts[2] == 'Comedy':
dest_file.write(line)
35. (i) Give one difference between CHAR and VARCHAR datatype in MySQL.
The fundamental difference between CHAR and VARCHAR is that the CHAR data type is fixed in length, while
the VARCHAR data type supports variable-length columns of data. But they are also similar. They both can
store alphanumeric data
(ii) Rahim wants to write a program in Python to insert the following record in the table named Bank_Account in
MySQL database,
· Cname – string
· Atype – string
· Amount – float
· Username – admin
· Password – root
· Host – localhost
The values of fields Accno, Cname, Atype and Amount have to be accepted from the user. Help Rahim to write the
program in Python.