You are on page 1of 40

CHAPTER 1: NETWORKING: BASICS OF INTERNET AND

MOBILE TECHNOLOGIES
Exercises
OBJECTIVE TYPE QUESTIONS
FILL IN THE BLANKS
1. Internet set of Computer Networks.
2. Internet works on packet switching.
3. The server on the internet is also known as host.
4. To access file from another computer on the internet is by File Transfer Protocol (FTP).
5. The name of the communication protocol used by the internet is TCP/IP.
6. Hypertext Transfer protocol will be used to access WWW.
7. A website is a collection of webpages.
8. SMTP is a simple mail transfer protocol.
9. E-mail address is made of two parts.
10. Telnet (Terminal network) is a protocol that facilitates remote login.

THEORETICAL QUESTIONS
A. SHORT ANSWER TYPE QUESTIONS
1. What do you mean by remote login?
Ans: Remote login gives access to an authorized person to login into a computer or network from a
geographical distance through a network connection.

2. Name any two websites which are used to send e-mails.


Ans: Gmail and Yahoo.

3. Write one characteristic each for 3G and 4G.


Ans: 3G provides high speed data access while 4G is good for streaming video, high-definition
mobile and TV.

4. What is the difference between HTTP and FTP?


Ans:
HTTP FTP
1. It stands for hypertext transfer protocol. 1. It stands for file transfer protocol.
2. It allows the process of transfer of web 2. It is used for the transfer of files between a
pages over the internet. client and server on a network.
3. It can transfer plain text, hypertext, audio, 3. It can transfer program files, multimedia
images, and internet accessible files, text files, documents, etc.
information.
4. It does not require any authentication. 4. It requires authentication.
5. It is specially used to communicate 5. FTP can efficiently transfer large files.
between browsers and web servers for
transferring small files on the web.
6. HTTP is faster. 6. FTP is slower as compared to HTTP.

5. How Facebook is different from Twitter?


Ans: Facebook is a complete social networking site where people can share large amount of text,
videos, files, etc. Whereas Twitter gives platform to convey ideas in the form of tweets, retweets.
Twitter has a limit of 140 characters per tweet.

6. Write the full of: HTTPS, SCP, SSH and Telnet.


Ans: HTTPS - Hypertext Transfer Protocol Secure.
SCP - Secure Copy Protocol.
SSH - Secure Shell.
Telnet - Terminal Network.

7. What is chatting?
Ans: Chatting is one of the popular ways to communicate with each other via messages instantly.

8. Explain HTTPS.
Ans: HTTPS (Hypertext transfer protocol secure) is used for transferring data between the client
browser (request) and the web server (response) in the hypertext format, in an encrypted format.
So, it can be said that HTTPS stop hackers from interpretation or modification of data throughout
the transfer of packets. All financial transactions on web are done using HTTPS.

9. Differentiate between static and dynamic webpages.


Ans: Static webpage — Static webpage is one where information is not changed frequently. In
other words, static webpage contains fixed information to visitors. Mostly static webpages are
made using HTML (hypertext markup language).
Dynamic webpage — Dynamic webpage is one which displays different information depending
upon the execution of either CGI (common gateway interface) scripts or server-side script. For
example, weather reporting websites shows different weather reports depending upon the date,
time and the location.

10. Differentiate between website and web portal.


Ans: Website: A website is a collection of interlinked webpages typically hosted from a single
domain. For example, Amazon.com is a commercial website and is built using several webpages.
Web portal: A web portal is a specially designed website that often serves as a single point of
access for various information and links. It connects the visitor to different sources (such as various
websites) of information through a single interface with ease.

B. LONG ANSWER TYPE QUESTIONS


1. Explain e-group.
Ans: E-group is an online community of people with similar interests. E-group is a feature in many
social networking sites which facilitates forming of groups. Groups allow members to create, post
content or comment, read, plan vacations, organize workshops, share photos and invite friends to
the group. In e-groups, members can communicate round the clock from anywhere. Their
conversation is documented for further use. In e-group discussions, members are free to share
their experiences. E-group discussions are mostly done in textual format. Google and MSN groups
allow to create e-groups.

2. Mention some disadvantages of an e-mail.


Ans: Disadvantages of an e-mail are:
 The recipient needs access to the internet to receive an e-mail.
 Viruses are easily spread via e-mail attachments (most e-mail providers scan e-mails for
viruses on your behalf).
 Phishing - Sending an e-mail to a user falsely claiming to be a legitimate company to scam
the user into providing information, such as personal information and bank account
numbers on a bogus website. The details will then be used for identity theft.
 No guarantee that the mail will be read until the user logs on and checks their e-mail.
 Spam - Unsolicited e-mail, i.e., junk mail.

3. What are the benefits of video conferencing?


Ans: Benefits of video conferencing are:
 Economical in terms of cost and time as people can be in their own locations and
communicate.
 Meetings can be organized at short notices.
 Visual communication builds trust and gives visual clues of the other person.
 Using video conferencing, training, workshops, or debates can be conducted at many
locations (worldwide) at one time.

4. List the benefits of e-learning.


Ans: Benefits of e-learning are:
 Provides online courses, online exams, learning materials, webinar for students and
teachers.
 Facilitates sharing of resources and submitting online homework and assignments.
 Helps in remote learning.
 Reduces the cost incurred for study.
 Encourages self-paced and self-motivated learning, anytime, anywhere.
 Resources like e-books and audio books are used.
 Helps to engage students in virtual learning through smart boards.
 Promotes same education to all.

5. List some advantage and disadvantages of an e-mail.


Ans: Advantages
 E-mails are delivered extremely fast when compared to traditional post.
 E-mails can be sent 24 hours a day, 365 days a year.
 Webmail means e-mails can be sent and received from any computer, anywhere in the
world, that has an internet connection.
 Cheap - When using broadband, each e-mail sent is effectively free. Dial-up users are
charged at local call rates, but it only takes a few seconds (for conventional e-mail, e.g., text
only) to send an e-mail.
 E-mails can be sent to one person or several people.
Disadvantages
 It can be a source of viruses, capable of harming one’s computer, and read out user’s e-mail
address book and send them to number of people around the world.
 It can be a source of various spams, which can fill up the inbox and deletion consumes lot of
time.
 It is an informal method of communication. The documents, which require signatures are
not managed by e-mail.
 To use facility of e-mail, user must have access to Internet and there are many parts of the
world where people does not have access to Internet.
 Sometimes, e-mails can be misunderstood as it is not capable of expressing emotions.

6. Mention benefits of social networking.


Ans: Advantages of social networking
 Enhance creativity, communication, and technological skills: People can share original
ideas and creative work on large platforms using social media. Students can self-learn new
things from social educational sites.
 Easy to find people: Social networking sites help to find people on net like using LinkedIn
you can find new employees for your company, Facebook can find your friends, family
members, etc.
 Cost effective: Social networking sites give immense opportunity to advertise your business,
event with minimum or no cost and reach out to audience around the world.
 Develop social awareness and connection in the real world: People read real stories,
climatic issues, competitions which make them more aware and participate in related
events happening around them. People can strengthen their relationships with their remote
friends and family members using social media.
 Build trust for your brand: Regular interaction through social media with customers can
help to increase trust and advocacy among the audience which can help to increase your
business.

7. Write a short note on reservation.


Ans: E-reservation is the online booking of tickets by e-mail or through a website. E-reservation can
be done easily from anywhere using internet. E-reservations require internet connection and a
login id and details of the person who requires reservation such as date and time of travel, name,
age, gender, etc. Payments can be done online. Nowadays, we use e-reservation for booking the
following:
Train tickets https://www.irctc.co.in/
Airlines tickets https://www.yatra.com/airlines/;
https://www.makemytrip.com/flights/airlines.html
Hotel rooms www.trivago.in/; https://www.redbus.in/hotels/
Movie tickets in.bookmyshow.com/

8. Define e-banking.
Ans: Electronic banking or e-banking is a universal term to define use of banking products and
services, by using electronic delivery channels. The services under e-banking includes funds
transfer, payment of bills, opening online bank accounts, etc. All services can be availed by
customers by filling e-banking registration form and submitting it to his/her bank. By doing this,
customers will receive login credentials to access their account online. In e-banking, the electronic
delivery channels are ATMs, mobile banking, telebanking, etc. All banking services can be availed
online. e-Banking is also known as virtual banking, online banking, doorstep banking, or internet
banking.

9. What are search engines?


Ans: To find information on a topic, a variety of search engines are available to fetch desired details
from different locations on the web. Identify the correct keyword(s) to lead your search then enter
those keywords and the search engine will fetch you a list of results.

10. Name any four websites to find people on net.


Ans: Four websites to find people on net are:
 TruePeopleSearch.com
 pipl.com
 PeekYou.com
 FindPeopleSearch.com

APPLICATION BASED QUESTIONS


1. Reena wants to post a picture on Facebook. How can she do this? Explain.
Ans: To post a picture on Facebook she should follow the steps given below:
 At the top of your Feed or timeline, click Photo/Video.
 Select the photos you want to share.
 If you like, you can:
o Click to add more photos.
o Click to tag friends. Learn more about how tagging works.
o Click to add a location.
o Click , then click Feeling/Activity to share what you are feeling or
doing.
 Hover over your photo and click Add Photos/Videos or Edit All to edit your photos.
 Select your audience, then click Post.

2. Mr. Rabindra wants to send money to his wife who is in another city. Tell him the easiest way
to transfer money through online banking.
Ans: e-Banking is the easiest way to transfer money through the bank.

3. Raman wants to participate in video conferencing. Suggest the hardware requirements for
this purpose.
Ans: To participate in video conferencing, the hardware requirements are:
 High-resolution webcam
 Sufficient network bandwidth
 Laptop/desktop/mobile
 Microphone, speaker
4. Janak wants to send an e-mail for the first time. Help her to create an e-mail account and then
send a mail.
Ans: To create an e-mail account and then send a mail below-mentioned steps should be
followed:
 E-mail ID can be created using any free account provider such as Gmail or Yahoo.
 While opening the e-mail account you will be required to fill an application form where you
will provide details, such as complete name, age, login id, set password, etc.
 Once you submit the details, your account will be operational in few minutes.
 For ending an e-mail, open Gmail.
 On the left, click Compose.
 (Optional) To change your window size, in the upper corner, click Maximize or Exit full
screen .
 Add recipients and a subject.
 Enter your message. E-mail, you start writing but don't send are automatically saved in
Drafts shown on the left.
 (Optional) Add attachments, such as Drive files or photos .
 Click Send.
CHAPTER 2: INTRODUCTION TO HTML
Exercises
OBJECTIVE TYPE QUESTIONS
A. MULTIPLE CHOICE QUESTIONS (MCQs)
1. The <HR> tag inserts on a webpage.
a) A straight line
b) A circle
c) A border
d) None of these
Ans: a) A straight line
2. To display “bullets” against list items we use:
a) <OL>
b) <UL>
c) Both of them
d) None of them
Ans: b) <UL>
3. Which tag leaves a blank line?
a) <Hr>
b) <Br>
c) <Line>
d) <empty>
Ans: b) <Br>
4. To assign the background image for the document, background attribute is used with which of
the following tags?
a) <BODY>
b) <HTML>
c) <P>
d) None of these
Ans: a) <BODY>
5. The number of levels HTML supports to tag headings in a document is
a) 4
b) 6
c) 8
d) 10
Ans: b) 6
6. Which HTML tag will be used to scroll a text in webpage?
a) <marquee> … </marquee>
b) <scroll> … </scroll>
c) <round> … </round>
d) <go> … </go>
Ans: a) <marquee> … </marquee>
7. How to set a picture as a background in webpage?
a) <body background= “bgimage.gif”>
b) <body background image= “bgimage.gif”>
c) <background= “bgimage.gif”>
d) <background image= “bgimage.gif”>
Ans: a) <body background= “bgimage.gif”>
8. Which tag is used to insert line break in HTML code?
a) <pr>
b) <lb>
c) <br>
d) <break>
Ans: c) <br>
9. HTML document is saved using extension.
a) .htl
b) .html
c) .hml
d) .htnl
Ans: b).html
10. The software that can read and render HTML documents is
a) Server
b) Compiler
c) Interpreter
d) Browser
Ans: d) Browser
11. HTML document can contain
a) Attributes
b) Tags
c) Plain text
d) All of these
Ans: d) all of these
12. HTML tags are surrounded by brackets
a) Angle
b) Square
c) Round
d) Curly
Ans: a) Angle
13. Opening tag of HTML is called
a) Ending tag
b) Starting tag
c) Closed tag
d) Pair tags
Ans: b) Starting tag
14. To create HTML document, you require a
a) Webpage editing software
b) High powered computer
c) Just a notepad can be used
d) None of the above
Ans: c) Just a notepad can be used
15. Which HTML tags cause browsers to render text as italics?
a) <text style = ‘‘italics’’></text>
b) <ital.></ital.>
c) <i></i>
d) <b></b>
Ans: c) <i></i>
16. Which attribute is not valid for <body> tag?
a) background
b) color
c) vlink
d) leftmargin
Ans: a) background
17. Which of the following code displays a less than symbol while loaded in browser?
a) &lt;
b) &gt;
c) &copy;
d) &nbsp;
Ans: a) &lt;
18. What does &nbsp; stand for?
a) Non-blocked space
b) Non-breaking space
c) Non-baked space
d) Never-broken space
Ans: b) non-breaking space
19. Which of the following tag displays the content in the middle of browser horizontally?
a) <p alignment=”centered”>
b) <p text-align=”center”>
c) <p aligned=”center”>
d) <p align=”center”>
Ans: d) <p align=”center”>
20. Inserting <br> tag inside a paragraph
a) Adds a new paragraph
b) Breaks a paragraph into two
c) Adds a line break so that new line is started within same paragraph
d) Makes it an empty paragraph
Ans: c) Adds a line break so that new line is started within same paragraph
21. An ordered list is a list and an unordered list is a list.
a) bulleted & numbered
b) bulleted & tabular
c) tabular & numbered
d) numbered & bulleted
Ans: d) numbered & bulleted
22. Title tag is nested within the tag.
a) Body
b) Head
c) List
d) Table
Ans: b) Head
23. Which of the following is not a single tag?
a) <p> tag
b) <br> tag
c) <hr> tag
d) <img> tag
Ans: d) <img> tag
24. If a tag has its corresponding closing tag, such tags are called,
a) empty tag
b) container tags
c) self-closing
d) none of above
Ans: b) container tags
25. Which attribute is used to control the length of <hr> horizontal line?
a) length=value
b) width=value
c) height=value
d) none of above
Ans: a) length=value
26. A paragraph can be aligned left, right, center or justified using <p> tag with attribute
a) text-align
b) alignment
c) align
d) text-direction
Ans: c) align
27. Attribute for choosing type of font is
a) character
b) basefont
c) font
d) type
Ans: d) type
28. Which of the following is correct to change the text color to red?
a) <BODY Bgcolor = red>
b) <BODY text = red>
c) <BODY color = red
d) none of the above
Ans: b) <BODY text=red>
29. In HTML, each parameter in RGB (red, green, blue) defines intensity of color between?
a) 0-90
b) 0-255
c) 0-65536
d) 0-infinity
Ans: b) 0-255
30. Choose the correct HTML tag for largest heading
a) <heading>
b) <H6>
c) <head>
d) <h1>
Ans: d) <h1>
31. Choose the correct syntax to create an e-mail link
a) <A href = "abc@xyz.com">
b) <A href = "mailto:abc@xyz.com">
c) <mail = "abc@xyz.com">
d) <A mail = "abc@xyz.com">
Ans: a) <A href = "abc@xyz.com">
32. To create a link, we must use attribute with <A> tag
a) name
b) link
c) tag
d) href
Ans: d) href
33. In Internal linking, the sections names are defined by attribute of <A> tag.
a) href
b) title
c) name
d) none of the above
Ans: c) name
34. Which attribute of <A> tag is used to open a link in a new window?
a) name
b) target
c) HREF
d) none of these
Ans: b) target
35. Which option of <A> tag is used to send e-mail from the browser?
a) Mailto
b) E-mail
c) Name
d) Href
Ans: a) Mailto
B. FILL IN THE BLANKS
1. HTML stands for Hyper Text Markup Language.
2. An Html document has two distinct parts Head and Body.
3. In HTML, the tags that have both an ON tag and an OFF tag are called container elements.
4. vlink is used to change the color of a visited link.
5. ul tag creates a bulleted list.
6. Background tag is used for inserting a background image.
7. For displaying colored text, text tag is used.
8. HR tag is used for horizontal line.
9. bgcolor attribute of the BODY tag is used to set the color of the background.
10. Width attribute is used to define the thickness of horizontal rule.

C. STATE TRUE OR FALSE


1. <Caption> tag gives heading to a webpage. False
2. <Head> defines the HTML header and does not affect the appearance of document. True
3. Line breaks are given through <BR>. True
4. Color attribute is used with <P> tag. False
5. HTML is case sensitive. False
6. There must be one <body> tag in each webpage. True
7. <I> tag displays text in bold. False
8. There are 9 heading levels in HTML. False
9. HTML is a programming language. False
10. There must be only one <HTML> tag in Html. True

THEORETICAL QUESTIONS
1. Write the HTML code to display a horizontal line of red color.
Ans:
<HTML>
<HEAD>
<TITLE>
RED HORIZONTAL LINE
</TITLE>
<HEAD>

<BODY>
<BR><H1> DISPLAY RED HORIZONTAL LINE</H1> <BR><BR>

<HR COLOR="red">

</BODY>
</HTML>
2. Write the HTML code to create a paragraph whose text color is Red.
Ans:
<HTML>
<HEAD><TITLE>A paragraph whose text color is Red </TITLE><HEAD>

<BODY>
<p style="color: red";> Paragraph text in red color </p>.
</BODY>
</HTML

3. Differentiate between <FONT SIZE > and <BASEFONT SIZE> tag.


Ans: The main difference between base font and font tag is that base font sets the font to be used
throughout the page whereas the font tag can be used to change the font for a particular section of
the page.

4. How can different tags be combined in HTML? What is its use?


Ans: Tags in HTML can be combined in order to get the desired results of both the tags on an
element such as text. For example, we can bold text using the bold (b) tag and we can also italicize
text using the italic (i) tag. To bold and italic text together, use the i tag inside the b tag or vice
versa.

5. How many types of lists are available in HTML? Name them.


Ans: There are three types of lists:
i. Ordered list
ii. Unordered list
iii. Definition list
6. Which tag is used to give blank space in HTML?
Ans: &nbsp tag is used for displaying one space between the text.

7. Name the attribute used with <A> tag to specify the URL of link.
Ans: The href attribute is used to define hyperlink in the <a> element.

8. What is the method of using comment line in HTML?


Ans: Comment is a statement which is not displayed on browser window. Comment makes it easy
to understand which code is written for what purpose. Comment may be a single line or it may be
a multiline. Comment tags <! -- and -->

9. Differentiate between empty and container elements in HTML.


Ans:
Empty tags Container tags
Empty tags do not require any closing tags. Container tags are followed by their
corresponding closing tags.
The name of the closing tag is same as that
of the opening tag, but the name is
preceded by a backslash (/).
Example: Example:
<HR> (tag that creates a horizontal rule) <HR> (tag that creates a horizontal rule)
<BR> (tag that creates a line break) <BR> (tag that creates a line break)

10. Identify the errors and write the correct HTML statements:
a. <BODY BGCOLOUR= “Red”>
b. <FONT TYPE = “Arial”>
Ans:
a. <body bgcolor= “Red”>
With HTML5 correct code will be:
<body style="background-color:red;">
b. <font type = “Arial”>
With HTML5 correct code will be:
<p style="font-family:Arial"
11. Write the html code to make background appear blue, text yellow, recently visited link green
and selected link as purple.
Ans: <BODY BGCOLOR = #0000FF TEXT = #FFFF00 LINK = 00ffff VLINK = 00FF00 ALINK = #800080>

12. Differentiate between absolute and relative URLs.


Ans: The main difference between an absolute URL and a relative URL is that, an absolute URL is a
complete address containing protocol, domain, and path while a relative URL points to a file
relative to the current directory or file. Using relative URLs are much easier since they are shorter
and more portable. But relative URLs can only be used to refer to links that reside on the same
server as the page that refers them.

13. Write down the correct syntax for creating a link on a webpage.
Ans:
<A HREF = " https://www.google.com/ "> is the correct syntax for creating a link to webpage.
Example
<A HREF = " https://www.google.com/ "> Open Google search engine </A>
Explanation:
 <a> tag refers to hyperlink.
 It is used to define a link among webpages.
 <a> has an attribute named as href attribute.
 The webpage which is to be linked is mentioned in href attribute.
 By default, an unvisited link is visible underlined and blue.
14. Write the HTML code to set page title as “My First Webpage”.
Ans:
<HTML>
<HEAD>
<TITLE>My First Webpage</TITLE>
</HEAD>
</HTML>

15. Write the HTML code to set image favorite.gif on your webpage.
Ans: <img src="C:\Users\Desktop\favorite.gif">

16. Name the attributes of <A> tag used to create an internal link in a webpage.
Ans: Internal link is linked within the same webpage. In this type of linking, a particular section is
defined by an <a> tag, used as the anchor point name, and is referred to an internal link into the
same page
<HTML>
<HEAD>
<TITLE>Internal Linking</TITLE>
</HEAD>
<BODY>
<A NAME="first"> <B>Fossil Fuels</B></A>
<P>The growing demand for energy was largely met by the fossil fuels – coal and petroleum. Our
technologies were also developed for using these energy sources. But these fuels were formed
over millions of years ago and there are only limited reserves. The fossil fuels are non-renewable
sources of energy.</P><BR><BR><BR><BR>
<H2><B>Hydro Power Plants</B></H2>
<P>Hydro power plants convert the potential energy of falling water into electricity </P>
<A HREF="#first"> go to Fossil Fuels</A>
</BODY>
</HTML>

17. Write the HTML code to display text in a particular font type. For example
Font size=5
Font face=Arial
Font color=green
Ans: <font face = "Arial" color=green size=5>
18. Write the html code to display usage of comment.
Ans:

19. Write the html code to display various bullet styles.


Ans:
<HTML>
<BODY>
<H2>Uses of fossil fuel</H2>
<BODY BGCOLOR="pink">
<FONT COLOR="green" size =5>
<UL>
<LI TYPE="square">In cooking: LPG (Petroleum product), Coal</LI>
<LI TYPE="disc">In vehicles: Petrol, diesels</LI>
<LI TYPE="circle">To produce electricity in Thermal power plant</LI>
</UL>
</BODY>
</HTML>
20. What is the extension of html code file?
Ans: The extension of html code file is .html.
21. Write down the different types of alignment attributes used in paragraphs.
Ans:
Align attribute is used to change the alignment of the paragraph.
<P ALIGN= “left”> used for left alignment of paragraph
<P ALIGN= “right”> used for right alignment of paragraph
<P ALIGN= “justify”> to justify a paragraph
22. Explain the structure of HTML file.
Ans: The basic structure of html file is:
<html>
<head>
<title>

</title>
</head>

<body>

</body>
</html>
23. A website on the topic ‘Green House Effect’ is to be set, which tags are used to give title and
headings of webpage.
Ans:
A <title> tag is an HTML element that specifies the title of a webpage. Heading is a text that is
separated from the other contents on a webpage. There are six heading levels in HTML, i.e., <H1>
to <H6>. As we increase through the heading levels, i.e., from H1 to H6, the size of the heading will
be decreased.
<HTML>
<HEAD>
<TITLE>Green House Effect</TITLE>
</HEAD>
<BODY BGCOLOR="yellow">
<H1>Heading 1</H1>
<H2>Heading 2</H2>
<H3>Heading 3</H3>
<H4>Heading 4</H4>
</BODY>
</HTML>

24. Name the two attributes of the body tag used to specify backgrounds.
Ans: Two attributes of body tag are:
• bgcolor - specifies the background color of a document.
• text - specifies the color of the text in a document.
<BODY BGCOLOR ="yellow" text="blue">

25. What do you understand by VLINK?


Ans:
Vlink: It is used to set color for visited link
<BODY TEXT = 00ff00 ” LINK = 0000ff VLINK = ff0000>
APPLICATION BASED QUESTIONS
1. Consider the following webpage and answer the following questions:

a. Which tag is used to display a horizontal line?


Ans: <hr>
b. Write the HTML code used for displaying heading color.
Ans: <H1 style="color:#0033cc;>
c. Write the HTML code for paragraph alignment.
Ans: <P ALIGN="center">
d. Write the HTML code for setting text color.
Ans: <BODY bgcolor = #00cccc text=#009922>
e. How many heading levels are used?
Ans: Three

CODE
<HTML>
<HEAD>
<TITLE>Green House Effect</TITLE>
</HEAD>
<BODY bgcolor = #00cccc text=#009922>
<H1 style="color:#0033cc;>
<Font face="arial"><b><P ALIGN="center">Working of Thermal Power Plant</b></Font></H1></p>
<hr width=100% color="gray" size="3"><Font color = #990000">
<h2>Thermal Power Plant is a plant in which electricity is produced from fossil fuel mainly
coal.</Font><br><br></h2>
<h3>
Large amount of fossil fuels is burnt every day in power station to heat up water to produce stem
which further runs the turbine to generate electricity.
<br><br>
The transmission of electricity is more efficient than transporting coal or petroleum over the same
distance. Therefore, many thermal power plant is used since fuel is burnt to produce heat energy
which is converted into electrical energy.
</h3>
</BODY>
</HTML>
2. Consider the following webpage and answer the given questions.

a. Write the HTML code to display the first heading of the webpage.
Ans: <H1 style="color:#0033cc;><Font face="Arial"><b> <P ALIGN="center">Wind
Energy</b></Font> </H1></p>
b. Write the HTML tag to display line in blue color.
Ans: <hr width=95% color="blue" size="2"><Font color = #990000">
c. Write down the HTML code to display an ordered list as shown in page.
Ans:
<OL>
<LI>No Pollution</LI>
<LI>Renewable</LI>
<LI>No recurring cost</LI>
d. Write the HTML code to display an unordered list as shown in page.
Ans:
<uL type ="disc">
<LI>high set up cost</LI>
<LI>Wind farms can be established at those places where windspeed is greater than 15 km/hr</LI>
<LI>Requires large area around 1 MW-2 hectare land</LI>
</UL>
e. Write the HTML code to change round bullet of unordered list to square bullet.
Ans: <uL type ="square">
f. Is there a nested list in given example?
Ans: Yes

3. Observe the given webpage and write HTML code to generate it.

Note the following points while generating the webpage.


 Title of page is “Energy from the Sea”
<HTML>
<Head>
<Title>“Energy from the Sea”
</Title>
</Head>
 Heading of the page is center aligned.
<P ALIGN="center">Energy from Sea</p>
 Background color code is #F5ECCE
<BODY bgcolor=#F5ECCE text= #1E8449>
 Font style for the page is Arial.
<Font face="Arial">
 Second and third heading of the page is Red in color.
<H1 style="color:ff0000;> <P ALIGN="center">Energy from Sea</H1></p>
<H1 style="color:ff0000;> <P ALIGN="center">Wind Energy</H1></p>
 Both the heading must be underlined
<H1 style="color:ff0000;> <u> <P ALIGN="center">Energy from Sea</H1> </u> </p>
<H1 style="color:ff0000;> <u> <P ALIGN="center">Wind Energy</H1> </u> </p>
Complete Code
<HTML>
<Head>
<Title>Energy from the Sea
</Title>
</Head>
<BODY bgcolor=#F5ECCE text= #1E8449>
<H1 style="color:ff0000;> <Font face="Arial"><b> <u> <P ALIGN="center"> Energy from Sea
</Font> </H1></p>
<Font color = ff0000><br> <h2>Tidal Energy<br><br></h2></u></Font>
<p>Due to the gravitational pull of mainly the moon on the spinning earth, the level of
water in the sea rises and falls. This phenomenon is called high and low tides and the
difference in sea levels gives us tidal energy. Tidal energy is harnessed by constructing a
dam across opening to the sea.

<hr width=100% color="blue" size="2" align ="Center">


<Font color = ff0000><br> <h2> <u>Wind Energy<br><br></h2></u> </Font>

The kinetic energy possessed by huge waves near the seashore can be trapped in a similar
manner to generate electricity. The waves are generated by strong winds blowing across the
sea.
</Body>
</HTML>
CHAPTER 3: ADVANCED HTML
Exercises
OBJECTIVE TYPE QUESTIONS
A. MULTIPLE CHOICE QUESTIONS (MCQs)
1. Which tag is used to insert an image in a webpage?
a) <A>
b) <IMG>
c) <UL>
d) <DL>
Ans: b) <IMG>
2. To display “bullets” against list items we use:
a) <OL>
b) <UL>
c) Both of them
d) None of them
Ans: b) <UL>
3. Which of these tags belongs to <table> tag?
a) <thead><body><tr>
b) <table><head><tfoot>
c) <table><tr><td>
d) <table><tr><tt>
Ans: c) <table><tr><td>
4. Which one of the following is not an option for aligning data in a table?
a) Justify
b) Right
c) Left
d) Center
Ans: a) Justify
5. With which code you can make an image work as link?
a) <A href=“URL”>Text</A>
b) <A href= ABC.html><img src=graphic.gif>Click Here</A>
c) <A ref=mailto:<img src=graphic.gif>Click Here</A>
d) None of the above
Ans: b) <A href= ABC.html><img src=graphic.gif>Click Here</A>
6. Which of these tags is/are used with <Table> tag?
a) <TR>
b) <TD>
c) <TH>
d) All of the above

Ans: d) All of the above


7. Which attribute(s) is/are used to merge rows?
a) Rowspan
b) Colspan
c) Both of them
d) None of the above
Ans: a) Rowspan
8. Which of the following is/are attributes of <TR> tag?
a) Text
b) Color
c) Align
d) All of the above
Ans: c) Align
9. A is a combination of row and column.
a) Cell
b) Record
c) Field
d) None of the above
Ans: a) Cell
10. Alt attribute is used to display an image in a web browser.
a) Yes
b) No
c) Can’t say
d) None of the above
Ans: a) Yes
11. Which of the following is true regarding the <caption> tag?
a) It defines a caption for the table.
b) It can specify only one caption per table.
c) It must be inserted immediately after <TABLE> tag.
d) All the above.
Ans: d) All the above
12. What are the two required attributes of HTML <IMG> tag?
a) SRC and ALT
b) ALT and MARK
c) CANVAS and SRC
d) CAPTION and SRC
Ans: a) SRC and ALT
13. Which of the following is not a valid value for align attribute of <img>?
a) top
b) middle
c) bottom
d) center
Ans: d) center
14. If we want an image to be the hyperlink, the correct syntax is:
a) <img src = image.gif><a href = try.html>click</a>
b) <a href = try.html><img src = image.gif>click</a>
c) <a href = image.gif><img src = try.html>click</a>
d) <img src = try.html>
Ans: a) <img src = image.gif><a href = try.html>click</a>
15. What is the cell padding in HTML?
a) It specifies the spacing between the cell content and its borders.
b) It specifies the spacing between the cell content and its headings.
c) It specifies the spacing between the cell content and its formatting.
d) It specifies the spacing between the cell content and its descriptions.
Ans: a) It specifies the spacing between the cell content and its borders.
16. Which attribute tells us how many rows a cell should span?
a) colspan = n
b) rowspan = n
c) Both (a) & (b)
d) None of the above
Ans: b) rowspan = n
17. Which of the following is the attribute of table?
a) SRC
b) LINK
c) CELLPADDING
d) BOLD
Ans: c) CELLPADDING
18. Which tag is used to add columns to tables?
a) <colspan>
b) <td>
c) <tr>
d) All of the above
Ans: b) <td>
19. <TD>…</TD> is used for
a) Table heading
b) Table record
c) Table row
d) None of the above
Ans: d) None of the above
20. Which tag tells where a link starts?
a) <l>
b) <star>
c) <a>
d) None of the above
Ans: c) <a>
21. What is the correct syntax in HTML for creating a link on a webpage?
a) <LINK SRC=’abc.html”>
b) <BODY LINK=”abc.html”>
c) <A SRC=”abc.html>
d) <A HREF= “abc.html”>
Ans: d) <A HREF= “abc.html”>
22. Choose the correct syntax to create an e-mail link:
a) <A href = "abc@xyz.com">
b) <A href = "mailto:abc@xyz.com">
c) <mail = "abc@xyz.com">
d) <A mail = "abc@xyz.com">
Ans: b) <A href = "mailto:abc@xyz.com">

How to set a picture as a background webpage?


e) <body background= “bgimage.gif”>
f) <body background image= “bgimage.gif”>
g) <background= “bgimage.gif”>
h) <background image= “bgimage.gif”>
Ans: a) <body background= “bgimage.gif”>
23. Choose the correct HTML tag to left-align the content of a cell.
a) <tdleft>
b) <td leftalign>
c) <valign= “left”>
d) <td align= “left”>
Ans: d) <td align= “left”>
24. Is it possible to insert a table within another table?
a) Yes, but there must be exactly 2 rows and 2 columns in first table.
b) Yes, table can be inserted into cell of another table.
c) Yes, but there must be no border in second table.
d) No, it’s not possible.
Ans: d) No, it’s not possible.
25. In order to add border to a table, border attribute is specified in which tag?
a) <TH>
b) <table>
c) <TD>
d) <TR>
Ans: b) <table>
26. rowspan=n can be added to only which tag?
a) <hr>
b) <table>
c) <td>
d) <tr>
Ans: c) <td>
27. The attribute adds space within each cell.
a) CELL SPACING
b) CELL PADDING
c) WIDTH
d) ALIGN
Ans: b) CELL PADDING
28. Which tag allows you to add a row in a table?
a) <td> and </td>
b) <cr> and </cr>
c) <th> and </th>
d) <tr> and </tr>
Ans: d) <tr> and </tr>
29. Which attribute of the <TABLE> tag is used to set an image in the background of a table?
a) BGCOLOR
b) BACKGROUND
c) FRAME
d) RULES
Ans: b) BACKGROUND

B. FILL IN THE BLANKS


1. <img> border attribute is used to give border to an image.
2. <TD> tag can only be present inside tr tag.
3. The default alignment of an image is left.
4. In HTML, while creating a table, we cannot use background attribute with tr tag.
5. To increase space between two cells, cell spacing attribute should be used.
6. tr tag is used to create a table row.
7. A tag that requires an opening as well as a closing tag is called a container tag.
8. The tag to start a table is <table>.
9. Anchor tag is used to connect webpages.
10. A tag that requires an opening as well as a closing tag is called a container tag.
11. Colspan attribute is used to span two or more columns in a Table.
12. Rowspan is used to combine the cell vertically.
13. The intersection of row and column in a table is known as cell.
14. The href attribute of <A> tag is used to specify the URL of a link.
15. The <tfoot> tag is used to define footer of a table.

C. STATE TRUE OR FALSE


1. BORDER is an attribute of a <A> tag in HTML. False
2. The ROWSPAN attribute of a table is used to merge more than one cell row-wise. True
3. MAILTO tag is used to send e-mail. True
4. Each cell of a table will be assigned with different colors. False
5. CAPTION tag is used to align a Table in HTML. False
6. A hyperlink applies to text only. False
7. <th> tags always need to come at the start of a column. True
8. The default alignment of an image is right. False
9. Alt attribute with <img> tag is used for alternate image. True
10. Cellpadding attribute is used with <td> tag. True
11. A table’s background color can be specified using background color attribute. True
12. SRC attribute specifies an alternate text for an image, if the image cannot be displayed. False
13. It is possible to create link within same document. True
14. CELLPADDING is the space between the contents of the cell and cell border. True
15. <TD> tag is used to define data heading of a table. False

THEORETICAL QUESTIONS
1. Write the HTML code to display a table with border of 5px.
Ans:
<html>
<body>
<table border = '5'>
<tr><td>l</td></tr>
<tr><td>2</td></tr>
</table>
</body>
</html>
2. Write the HTML code to display an image on the right side of page.
Ans:
<html>
<body>
<img src=”image.jpg” align=”right”>
</body>
</html>
3. Name the attributes of <img> tag which are used for specifying its dimensions in a webpage.
Ans: Width and height
4. Write the full forms of the following:
Ans:
i. <TD> = table definition
ii. HTML = hyper text markup language
iii. ALT = alternate text
iv. <TFOOT> = table foot

5. What is the difference between cellspacing and cellpadding attribute of a table?


Ans: Cellpadding basically defines the space present between a table cell's border and the content
present in it. Cellspacing basically defines the space present between individual adjacent cells.

6. Write the HTML code to insert an image on webpage named mypic.jpg located at c:\.
Ans:
<html>
<body>
<img src=”c:/mypic.jpg”>
</body>
</html>

7. Write the HTML code to give ‘Red’ as a background color to table.


Ans: <table bgcolor=”red”>

8. Write the HTML code to display the given table.

Ans:
<table>
<tr>
<th colspan=”4”>My Hobbies</th>
</tr>
<tr>
<td>Dancing</td>
<td>Reading</td>
<td>Swimming</td>
<td>Music</td>
</tr>
<tr>
<td colspan=”4”>Everyone has talent.</td>
</tr>
</table>
9. Write the HTML code to display the given table.

Ans:
<table>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr>
<td rowspan=”2”>D</td>
<td>E</td>
<td rowspan=”2”>F</td>
</tr>
<tr>
<td>G</td>
</tr>
<tr>
<td colspan=”3”>I</td>
</tr>
</table>
10. Write an HTML code to insert an image to a cell of table.
Ans:
<td>
<img src=”image.jpg”>
</td>
11. Differentiate between cellspacing and cellpadding.
Ans: Cellpadding basically defines the space present between a table cell's border and the content
present in it. Cellspacing basically defines the space present between individual adjacent cells.

12. Write the HTML code to create an ‘image1.jpg’ as a hyperlink to file ‘Description.html’.
Ans: <a href=”description.html”><img src=”image1.jpg”></a>
13. Write down the different attributes of <IMG> tag.
Ans: Src and alt
14. How many alignments are available for aligning images in a webpage? Name them.
Ans: In HTML, five types of alignment are available to align an image, which are:
i. Top
ii. Middle
iii. Bottom
iv. Left
v. Right
15. Define <THEAD>, <TBODY> and <TFOOT> tags of a table.
Ans:
<thead> = The <thead> tag is used to group header content in an HTML table.
<tbody> = The <tbody> tag is used to group the body content in an HTML table
<tfoot> = The <tfoot> (short for table foot) element defines a table's footer. It is typically used to
group a set of table rows summarizing the columns of the table

16. Write a HTML code to create a table of 5 Columns and 3 Rows.


a. Header row have a ‘pink’ color while other two rows have ‘yellow’ color.
Ans: <table>
<tr>
<th bgcolor=”pink”>column1</th>
<th bgcolor=”pink”>column2</th>
<th bgcolor=”pink”>column3</th>
<th bgcolor=”pink”>column4</th>
<th bgcolor=”pink”>column5</th>
</tr>
<tr>
<td bgcolor=”yellow”>data1</td>
<td bgcolor=”yellow”>data2</td>
<td bgcolor=”yellow”>data3</td>
<td bgcolor=”yellow”>data4</td>
<td bgcolor=”yellow”>data5</td>
</tr>
<tr>
<td bgcolor=”yellow”>data6</td>
<td bgcolor=”yellow”>data7</td>
<td bgcolor=”yellow”>data8</td>
<td bgcolor=”yellow”>data9</td>
<td bgcolor=”yellow”>data10</td>
</tr>
</table>

17. Observe the following table and write the HTML code to generate it.

Ans:
<table>
<tr>
<th colspan=”2”>SUBJECT</th>
<th>STUDENT A</th>
<th>STUDENT B</th>
</tr>
<tr>
<td colspan=”2”>BIOLOGY</td>
<td>PRACTICAL</td>
<td>A+</td>
<td>A</td>
</tr>
<tr>
<td>THEORY</td>
<td>A+</td>
<td>A</td>
</tr>
<tr>
<td colspan=”2”>CHEMISTRY</td>
<td>PRACTICAL</td>
<td>A+</td>
<td>A</td>
</tr>
<tr>
<td>THEORY</td>
<td>B+</td>
<td>B</td>
</tr>
<tr>
<td colspan=”2”>PHYSICS</td>
<td>PRACTICAL</td>
<td>C+</td>
<td>B</td>
</tr>
<tr>
<td>THEORY</td>
<td>A+</td>
<td>A</td>
</tr>
</table>

18. Write the HTML code to display an inline image named student.jpg located at c:\ in the
center of your webpage.
Ans:
<html>
<body>
<center>
<img src=”c:\student.jpg”>
</center>
</body>
</html>
19. What happens when we click on a hyperlink on webpage?
Ans: When we click on a hyperlink in a webpage it provides a link that leads from one document to
another.

20. Identify which of the following is a tag or an attribute.


Ans:
i. table = tag
ii. align = attribute
iii. img = tag
iv. border = attribute
v. width = attribute

21. Name the attributes of <A>tag which are used for internal linking in a webpage.
Ans: <name> and <href> are attributes which are used for internal linking in a webpage.

22. Name the tags used to specify


Ans:
i. table data
ii. table header
iii. table row. = <table>

23. Name the two common attributes of <IMG> and <TABLE> tag.
Ans: Height and width.

24. Name the various attributes of <TR> tag.


Ans: Align, bgcolor, char, charoff, valign.

25. Define ROWSPAN and COLSPAN attributes of table.


Ans: The rowspan and colspan are <td> tag attributes. These are used to specify the number of
rows or columns a cell should span. The rowspan attribute is for rows as well as the colspan
attribute is for columns. These attributes have numeric values, for example, colspan=3 will span
three columns.

APPLICATION BASED QUESTIONS


1. Observe the given webpage and write HTML code to generate it.
Note the following points while generating the webpage.

 Title of the page is “Missile Man”.


Ans: <title>Missile Man</title>

 Background color code is #F9F2DD.


Ans: <body bgcolor=”#F9F2DD”>

 Heading level is H1.


Ans: <h1>A.P.J. Abdul Kalam</h1>

 Font color of the heading is ‘Red’ and ‘Center’ aligned.


Ans: <h1 align=center” text=”red”>A.P.J. Abdul Kalam</h1>

 Image is right aligned.


Ans: <img src=”image.jpg” align=”right”>

 Border of image is 3 px.


Ans: <img src=”image.jpg” align=”right” border=”3”>

 Table background color is yellow.


Ans: <table bgcolor=”yellow”>

 There is hyperlink ‘His Awards and Achievements’ of file ‘description.html’ saved in drive d:\.
Ans: <a href=”d:\description.html>His Awards and Achievements</a>

2. Consider the following webpage and answer the given questions.


a. Write the HTML code to give title “TAJ MAHAL” to the webpage.
Ans: <h1>TAJ MAHAL</h1>
b. Write the HTML tag to set green as background color.
Ans: <body bgcolor=”green”>
c. Write down the HTML code to display image at the right side of the webpage with border
of 3 points.
Ans: <img src=”image.jpg” align=”right” border=”3”>
d. Write the HTML code to form a given table.
Ans:
<table border=”1” bordercolor=”red” bgcolor=”yellow”>
<tr>
<th align=center>Fast Facts</th>
</tr>
<tr>
<td>Years of construction: 1631</td>
</tr>
<tr>
<td>Completed in 1653</td>
</tr>
<tr>
<td>Time taken: 22 years</td>
</tr>
<tr>
<td>Built by: Shah Jahan</td>
</tr>
<tr>
<td>Dedicated to Mumtaz Mahal, wife of Shah Jahan</td>
</tr>
<tr>
<td>Cost of construction: 32 crore rupees</td>
</tr>
<tr>
<td> Number of workers: 20,000</td>
</tr>
3. Observe the following table and write HTML code to generate it.
Ans:
<HTML>
<BODY>
<TABLE>
<tr>
<td rowspan=”3”>A</td>
<td colspan=”3”>B</td>
</tr>
<tr>
<td>C</td>
<td>D</td>
<td>E</td>
</tr>
<tr>
<td colspan=”3”>F</td>
</tr>
</table>
</body>

================================== X ==================================
CHAPTER 4: HTML FORMS
Exercises
OBJECTIVE TYPE QUESTIONS
MULTIPLE CHOICE QUESTIONS (MCQs)
1. Which is the default of ‘type’ attribute of <input> element?
a) Text
b) Password
c) Numerals
d) Special Characters
Ans: a) Text
2. Which attribute defines the file-select field?
a) file
b) checkbox
c) button
d) text
Ans: a) file
3. Which of the following is not used with password attribute?
a) name
b) size
c) maxlength
d) min
Ans: d) min
4. Which element is used to create multiline text input?
a) text
b) textarea
c) submit
d) radio button
Ans: b) textarea
5. Which attribute is not used for the radio type?
a) name
b) value
c) checked
d) selected
Ans: d) selected
6. Which attribute is used with <select> element?
a) multiple
b) selected
c) name
d) value
Ans: a) multiple
THEORETICAL QUESTIONS
1. Mention the purpose of using Web Forms.
Ans: A web form is a medium that allows your visitors to get in contact with you and to send
information, such as an order, a catalogue request, or even a query, which is passed on to your
database.

2. What are Web Forms?


Ans: A web form (or HTML form) is a place where users enter data or personal information that is
then sent to a server for processing.

3. Differentiate between
1. Get & Post methods of Form tag
2. Text Field and Text Area Controls
3. Radio buttons and Check box
Ans:
1. The GET and POST method are used for sending the data to the server, and the main
difference between them is that GET method append the data to the URI defined in the
form’s action attribute. Conversely, POST method attaches data to the requested body.
2. The major difference between a text area and a text field is that a text field only has one line
whereas a text area is usually has multiple lines.
3. Checkboxes allow the user to choose items from a fixed number of alternatives, while radio
buttons allow the user to choose exactly one item from a list of several predefined
alternatives.

4. Mention all attributes of following controls used in forms.


Ans:
1. Text = type, name, value, size, maxlength
2. Checkbox = type, name, value, checked
3. Radio = type, name, value
4. Password = type, name, value, size, maxlength
5. Submit = type, name, value
6. Reset = type, name, value

5. Which method is used to send form data as URL variables?


Ans: <form method=”POST”>

6. How can you select 3rd option by default in a list used in HTML Forms?
Ans: The default value of the select element can be set by using the 'selected' attribute on the
required option. This is a Boolean attribute. The option that is having the 'selected' attribute will be
displayed by default on the dropdown list.

APPLICATION BASED QUESTIONS


1. Write an HTML code for creating a form, which accepts the birth date from the user in a
textbox and displays the day of the week in a message box on the click of a button.
Ans:
<form onsubmit = 'myFunction()'>
<label for="start">Enter Your Birth Date (YYYY-MM-DD):</label>
<input type="text" id="bday" name="bday" value="2000-01-01" id="bday">
<BR><BR>
<input type="submit" value="Show Week Day Name">
<script type= 'text/javascript'>
function myFunction()
{
var a = new Date(document.getElementById("bday").value)
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var DayName=days[a.getDay()]
document.write("Week Day Name:" + DayName)
}
</script>
</form>
Output

2. Write code to create the following HTML Form to accept User’s Information as part of a
Magazine Survey:

Note: Address accepts multiline text.


Ans:
<form>
<B>User Survey</B> <br>
<label for="Name">Name: </label> <br>
<input type="text" id="Name" name="Name"/> <br>
<label for="Address">Address: </label>
<input type="text" id="lastname" name="lastname"/> <br>
<input type="radio" id="gender" name="gender" value="male"/>Male
<input type="radio" id="gender" name="gender" value="female"/>Female <br/>
You came to know about your magazine from:
<input type="checkbox" id="Friend" name="Friend" value="Friend"/>
<label for="Friend">Friend</label>
<input type="checkbox" id="Newspaper" name="Newspaper" value="Newspaper"/>
<label for="Newspaper">Newspaper</label>
<input type="checkbox" id="TV/Radio" name="TV/Radio" value="TV/Radio"/>
<label for="TV/Radio">TV/Radio</label>
<input type="checkbox" id="Others" name="Others" value="Others"/>
<label for="Others">Others</label>
</form>

3. What is FORM tag? Explain with example.


Ans: An HTML form is a section of a document which contains controls such as text fields, password
fields, checkboxes, radio buttons, submit button, menus, etc.
An HTML form facilitates the user to enter data that is to be sent to the server for processing, such
as name, e-mail address, password, phone number, etc.

4. Write a program to declare 2 radio buttons (Male, Female) and one check box (hobbies) in the
HTML form.
Ans: <form>
<label for="gender">Gender: </label>
<input type="radio" id="gender" name="gender" value="male"/>Male
<input type="radio" id="gender" name="gender" value="female"/>Female<br/>
<input type="checkbox" id="hobby" name="hobby" value="hobby"/>
</form>

5. Write code to create the following HTML Form:

Ans:
<body>
<form>
Please input your name<br>
<input type="text" name="username">
<input type="submit" value="submit">
</form>

</body>

You might also like