NCERT Class 11 Computers Part 2
NCERT Class 11 Computers Part 2
NCERT Class 11 Computers Part 2
Indira Gandhi National Open University, New Delhi. We are indebted to the
institutions and organisations which have generously permitted us to draw upon
their resources, material and personnel. We are especially grateful to the members
of the National Monitoring Committee, appointed by the Department of Secondary
and Higher Education, Ministry of Human Resource Development under the
Chairpersonship of Professor Mrinal Miri and Professor G.P. Deshpande, for their
valuable time and contribution.
As an organisation committed to systemic reform and continuous
improvement in the quality of its products, NCERT welcomes comments
and suggestions which will enable us to undertake further revision and
refinement.
Director
(iv)
New Delhi
May 2008
PREFACE
Computers have become a way of life in the present day world. That everyone
should be educated about the implications of this technology is the need
of the hour. Till now NCERT has not proposed a course or brought out a
textbook in this area. The course outlined for this textbook is an attempt
to design a generally friendly course that would not only be contemporary
but also leave sufficient scope for expansion into unknown realms of
computer activity that may emerge in future.
The National Curriculum Framework 2005 recommends that theoretical
component of Higher Secondary stage should emphasise on problem solving
methods and that the awareness of historical development of key concepts
be judiciously integrated into the content of a subject. It also recommends
that given the pervasive impact of computer and communication
technologies (CCT), a course related to this should address this
infrastructure challenge seriously and explore viable and innovative
alternatives with regard to hardware, software and connectivity
technologies appropriate for rural and urban Indian schools.
NCF 2005 states that the book should act as an instrument for achieving
social change in order to reduce the divide based on economic class, gender,
caste, religion and region. NCF also speaks about tremendous effectiveness
of the computer and computing technology in shaping modern society
which has created the need for an educated public that can utilise such
technology most effectively for the betterment of society and humankind.
This book is aligned to these broad guidelines of NCF.
Presumably, this would be a coveted book for everybody, irrespective
of any particular stream of higher secondary stage, for it deals with the
real challenges that the discipline is trying to solve. It emphasises
development of problem-solving and, equally important, problemformulating skills. It reduces the importance of technology and underscores
the need for learning skills to manipulate the technology. It focuses on
some of the real problems that come up with the expansion of the technology
security, piracy and digital identity. Above all, the course focuses as
This book has some features which, we earnestly hope will enhance its
usefulness for the students. Each chapter is provided with objectives in
the beginning and a summary at its end for a quick overview of the contents
of the chapter. There are some questions which require critical thinking
which would make a student think about real-time application of CCT.
Further, a large number of solved examples are included in the text in
order to clarify the concepts and/or to illustrate the application of these
concepts in everyday real-life situations. Some Practical activities/Case
studies have been included which provokes students for deep thinking.
Some of these are from real-life situations. Students are urged to solve
these and in doing so, they may find them very educative. Some items
inside boxes are introduced in many chapters either for this purpose or to
highlight some special features of the contents requiring additional
attention of the learners. Some information has been provided in shaded
box which is meant for supplementary reading and not for evaluation.
Glossary of terms and concepts is given towards the end which will act as
a ready reckoner.
Completing this book has only been possible because of the spontaneous
and continuous support of many people. We express our gratitude to the
Director, NCERT, for entrusting us with the task of preparing this textbook
as a part of national effort for improving general/school education. The
Head, Department of Computer Education and Technological Aids, NCERT,
was always willing to help us in our endeavour in every possible way.
The draft got excellent academic inputs from teachers, students and
experts who sincerely suggested improvement during the development of
this book. We are thankful to all those who conveyed these inputs to
NCERT. We are also thankful to the members of the Review Workshop
organised to discuss and refine the first draft.
We welcome suggestions and comments from our valued users, especially
students and teachers. We wish our young readers a happy journey to the
exciting realm of CCT.
M. M. Pant
Chief Advisor
Textbook Development Committee
(vii)
MEMBERS
Arpita Burman, Scientist D, National Information Centre (NIC), Department of
Information Technology, Ministry of Communication and Information Technology,
New Delhi
Basav Roychoudhury, Lecturer, Rajiv Gandhi Indian Institute of Management (RGIIM),
Shillong(Meghalaya)
C. Gurumurthy, Director (Academic), Central Board of Secondary Education, Shiksha
Kendra, New Delhi
Chandita Mukherjee, Director, Comet Media Foundation, Mumbai
Deepak Shudhalwar, Lecturer, PSSCIVE, Bhopal
Divya Jyoti, PGT, Computer Science, SLS DAV Public School, Mausam Vihar, Delhi
Gurpreet Kaur, Head, Department of Computer Science, G. D. Goenka Public School,
Vasant Kunj, New Delhi
H.N.S. Rao, Deputy Commissioner (Academic) (Retired), Navodaya Vidyalaya Samiti (NVS),
New Delhi
Rajendra Tripathi, Facilitator - People Development, Azim Premji Foundation, Bangalore
M.P.S. Bhatia, Assistant. Professor, Netaji Subhas Institute of Technology, New Delhi
Manish Kumar, PGT, Rajkiya Pratibha Vikas Vidyalaya, Raj Nivas Marg, Delhi
Mukesh Kumar, Head, Department of Computer Science, Delhi Public School,
R.K. Puram, New Delhi
Prakash Khanale, Vice Principal, DEM College of Parbhani, Maharashtra
COORDINATOR
Asha Jindal, Reader, DCETA, NCERT, New Delhi
TEAM MEMBER
Rajaram S. Sharma, Professor & Head, DCETA, NCERT, New Delhi
(ix)
ACKNOWLEDGEMENTS
The National Council of Educational Research and Training (NCERT)
gratefully acknowledges the valuable contributions of individuals and
organisations involved in the development of the Part II of the textbook
Computers and Communication Technology (CCT) for Class XI.
Acknowledgements are also due to the following practicing teachers and
subject experts for reviewing the draft manuscript and giving useful
suggestions for its improvement: Smt. Arpita Burman, Dr. Basav
Roychoudhary, Prof. Utpal Mallik, Smt. Chandita Mukherjee, Smt. C.
Gurumurthy, Shri H.N.S. Rao, Dr. Prakash Khanale, Dr. Deepak
Shudhalwar, Smt. Divya Jyoti, Smt. Gurpreet Kaur, V. P. Chahal, Manish
Kumar, Mukesh Kumar, Dr. M.P.S. Bhatia, Rajendra Tripathi, Dr. Rajni
Jindal, Dr. Sushila Madan and Shri Ravindra Singh.
The Council also thanks Prof. Vasudha Kamath (Joint Director, CIET),
Prof. Kamlesh Mittal and Smt. Pushp Lata Verma for their support and
help at various stages.
The Council also acknowledges the contributions of the supporting
staff of Department of Computer Education and Technological Aids
(DCETA), Moqaddas Azam DTP Operator in shaping this book. The efforts
of the Publication Department, NCERT are also duly acknowledged.
The Council is grateful to the websites and authors who have offered
images, illustrations and content in the public domain. Specific credits
are given at appropriate places in the textbook.
The Council gratefully acknowledges continuous help and support from
Prof. M. M. Pant, Chief Advisor, Textbook Development Committee in
conceiving and developing the textbook.
CONTENTS
UNIT IV
WEB PUBLISHING TECHNOLOGIES
Chapter 9
Chapter 10 :
229322
231
274
UNIT V
TEAMWORK AND WEB BASED COLLABORATION TOOLS
323356
Chapter 11 :
325
Chapter 12 :
349
UNIT VI
EMERGING TECHNOLOGIES
357385
Chapter 13 :
359
Chapter 14 :
376
GLOSSARY
386395
INDEX
396401
Introduction
As we have learnt earlier, the Internet is a very
large network of computers spread across the
world. The Internet allows for each of these
computers to send and receive information from
each other. One of the major applications of
the Internet is the World Wide Web (WWW). The
World Wide Web or the web in short, can be
thought of as an interconnected set of
documents, images, audio, video files or
software files.
When you connect to the Internet and look
around (we call it browsing), you are using a
very interesting feature of the web, hyperlinks.
Each time you click on a highlighted piece of
text or image, you jump to another piece of text
or image and this could be on the same page,
another page on the same hard disk or on a page
residing on another computer, half way across
the world.
How this works and how we could make it
happen is what we will learn in this chapter. Web
pages use a language called the Hyper Text
Markup Language (HTML). The browser
body of the page : This part of the page contains all the content
that you wish to present. The content could be of a variety of types
text, images, tables, forms, etc. We have organised the page in
two columns. While the left column contains text, formatted in
different ways, the right column contains some features unique to
a web page links, images which link to an image gallery, a comment
form and a poll. It is such features which make a page interactive.
a footer area : This is at the bottom of the page and usually contains
disclaimers, copyright information, etc. In our case, the footer text
states, All material on this site can be freely downloaded, distributed
or reused.
We will analyse the page and its sections further. We will also
learn how to construct such web pages. In order to extend your
knowledge, do look at a variety of web pages, each time noting down
the layout and categorisation of content. Web page design has evolved
into a very sophisticated activity, where artists and programmers
work together to put together very elaborate features in order to make
web pages interactive.
As we mentioned in the introduction, you need an application
software called an Internet browser to view web pages. While all browsers
are designed to interpret HTML and display web pages, they can be
designed for different operating systems. You can have many browsers
installed on your computer and use them simultaneously. Most browsers
are free and can be downloaded from the web. Some popular browsers
are listed below :
Browser
Operating System
Mozilla Firefox
Internet Explorer
Microsoft Windows
Googles Chrome
Microsoft Windows
Opera
Microsoft Windows
Safari
references to such files. So when you see a photograph on the web page,
the HTML file has called the image file and displayed it in the appropriate
place on the web page. The fact that this is a text file, makes it platform
independent meaning that the same web page could be seen on a
Windows, Unix, Linux or a MacOS computer. This is also the reason
why the web is emerging as a universal medium of communication.
We mentioned that what traverses the web is the html code. It is
this code that helps a browser construct the web page. But, how do
you see the html code? Right-click on the page and from the options
displayed, select view page source. You should now see the html
code. This may look very threatening, but let us assure you that it
is actually quite simple and you should be able to write it by the
end of this chapter.
Notice the code <HTML> at the top of the page. If we scroll down to
the bottom of the page, we will see the code </HTML>. We refer to such
codes as tags. Learning to make web pages is all about learning to use
these tags to present content the way you want. The general format for
a HTML tag is :
The opening tag consists of just the tag name and it instructs the
web browser to start tagging (formatting) the text. The ending tag
includes a slash preceding the tag name. This / slash tells a web
browser to stop tagging the text. Let us look at a few examples:
If you want your text to be highlighted, say using bold type face,
you use
and what you get on the web page is HTML tags. Notice that the
tag is not case sensitive, that is, <B> HTML tags </B> would have
yielded the same result. An interesting aspect of a HTML tag is that
if the browser does not know what to do with a given tag, it will
simply ignore it!
There are two types of tags :
Container tags : The HTML tags which require a closing tag are
called container tags. These tags are also called paired or wrapper
tags. The <b> text </b> is one such pair. If you do not close such
tags, all the following text would be treated as if they are part of
this tag.
Non-container tags : The HTML tags which do not require a closing
tag are called non-container tags. These tags are also called stand
alone or empty tags. A typical example is that of <br>. This tag
inserts a line break.
9.2.1 ATTRIBUTES
Some tags are complete in themselves. In other words, they have only
one option. For instance, when you want your text, say italicised, you
use <i> text </i>. But if you wish to display text, say in some particular
font, how will the tag look then?
Notice the tag in this example is <font> </font>. What about the
remaining part, face= Arial We refer to this additional information as
the tags attribute. So, in our example, the tag is font, its attribute is
face and the value given to the attribute is Arial.
Attributes may have many different values you may like to use
simultaneously. For instance, you may not only like a particular font,
Note the use of quotes to indicate values and semi-colons to separate
attributes. The general form of the tag is :
As a general rule, most attributes that include only letters, digits,
hyphens, or periods work fine without quotes. Attributes that have
other characters, such as spaces, % signs, or # signs, however, always
require quotes. Nevertheless, it is a good habit to enclose all attribute
values in quotes.
The purpose of the attribute is to extend the scope of a tag. It provides
additional information about the tag, to the browser.
How does the browser treat a tag, which requires an attribute, but
no attribute is mentioned. For instance in our example if we had just
used <font>text</font>, how would the browser show it. The best way
to figure this out is to try it out yourself.
Each browser has a default setting, which is the value it takes
when no other value is defined. In Windows Internet Explorer, the
default font setting is font:Times New Roman; font-size:12pt and
color:#000000. So if you only have the <font>text</font> tag without
any attributes, then the text would be in 12 point, Times New Roman
font and its colour would be black. You can of course change this
default setting to whatever you wish. Go to Tools->Internet Options
and click on the font button under the general tab. There are many
other defaults and you can set any or all of them to customise your
browser to your requirement.
The sections of the page are then defined. In our page we have a
header, a body and a footer. The tags are <head></head> and
<body></body>.
All the contents of the web page displayed in the browser window
are between the tags <body></body>. In our web page, this includes
the following :
the banner, Computers and Communication Technology against a
coloured background;
the menu bar with buttons to each chapter;
all the text in the left column, again against a coloured background;
a set of hyperlinks;
two input boxes; and
the footer
We will explore the tags associated with each of these in the
subsequent sections.
Notepad will give the file a default extension of .txt. But we wish to
make a web page. Therefore name the file home.htm
Let us now preview our web page. Open the file home.htm in a
browser (Figure 9.4).
From the first two examples, you will notice that you can either use the
name of the colour or its hexadecimal code. You may look up the hex codes
in a graphics application like Gimp or Photoshop, or look up on the web.
From the third example you will notice that we have defined not
only a colour, but also an image for the background. The image will be
overlaid on the coloured background. So if the image is big enough,
you will only see the image as the background. If it is smaller than the
screen, the background colour will be visible all around. You will learn
about managing images in a later section.
In the previous section, we examined the <head></head> pair of
the HTML tags, included a title for our web page. Let us continue our
exploration of our web page. Our web page could be visualised as
figure 9.6 consisting of the following:
OF
<! >
When you write a long piece of coding, or if you are writing a piece of
code which you want someone else to edit or use, it would be a good
habit to mark out sections with labels. At the same time, you do not
want these to be visible on the web page. One useful tag for this purpose
is the comment tag <! text >. For example,
<! the following section will display the image gallery >
Anything in between the comment tags is ignored and is NOT
displayed in a browser. Comments can be multi-line too, and only one
set of start and end tags can be used to enclose all the lines.
OF
Notice that the banner has text in a large font size. There are many
ways of achieving this. You could define a font size, you could use
pre-defined sizes, or even use an image containing the text. The last
option is preferred when a particularly unique style of text or text
effect is to be used, something which cannot be obtained using normal
HTML coding.
While it is possible to define the exact font size (we will look at this
option a little later), HTML provides six levels of text for use as headings.
They are numbered 1 to 6, with 1 being the largest and 6 being the smallest.
But, how big is h1 and how small is h6? These are relative sizes. Now, if
you have six sentences in sizes h1 to h6 as in figure 9.7 and go to view->
zoom->zoom in or press Ctrl++, each of these sentences become bigger.
Continue doing this and the text keeps growing in size. They maintain
their relative sizes. Now, go to view ! zoom ! zoom out or press Ctrl, the
text becomes progressively smaller, still retaining their relative sizes.
The tags used in this case are <h1>text</h1>, <h2>text</h2>, etc.
all the way to <h6>text</h6>. Look at these examples.
OF
The <hn></hn> tag of course will use the default font of the browser
and display text in varying sizes. So, what do you do if you want the
text to be displayed in different fonts?
This is how we
<i>italicize</i>text; and
This is how we
<u>underline</u> text.
OF
TEXT
Running text is usually broken into paragraphs, and with the advent
of word processors, text is also justified (aligned) in different ways. We
may also have to force a line break to avoid an orphaned or a widowed
line (a single line of text on the bottom or top of a page). Let us explore
the tags used for this purpose.
When used on its own, this tag will define blank lines. This is useful
when you wish to forcibly separate blocks of text. See the example below.
Figure 9.9 : This piece of text will have a blank line in between
While width indicates the length of the line, size indicates the thickness.
OF
CONTENT
bicycle
bullock cart
car
bus
train
ship
The tag pair <ul> and </ul> stands for the unordered list, while
<li>stands for list item. You may use a </li> to close the tag, but this
is optional. Notice the bullet before each item. This is generated by the
<li> tag. There is no limit to the number of list items you may have in
a single list.
The ordered list is very much similar in structure to the unordered
list, except that the opening tag for the list is <ol> instead of <ul>, and
the closing tag is </ol> instead of </ul>. List items within the list still
use the same tags.
An example of an Ordered List...
1 Argentina
2 Bhutan
3 Canada
4 Denmark
5 Ethiopia
6 France
<tr></tr>
<td></td>
This pair (<td> stands for table data) defines a cell and
number of such pairs you use will define the number of
cells your row is divided into.
<th></th>
<caption> </caption>
in the <table> tag, it affects the entire table (cells as well as the
margins).
in the <tr> tag, it affects the entire row (cells only). It overrides the
colour specified in the <table> tag.
The BACKGROUND attribute does not work if specified in the <tr> tag.
in the <td> tag, it affects the specified cell. It overrides the colour/
image specified in the <table> or the <tr> tag.
Adjusting the sizes of the table and its cells
When no sizes are specified the table is only as big as it needs to be
according to its contents. The attributes WIDTH and HEIGHT can be
used to control the width and the height of the table respectively.
These attributes can be specified either as a percentage (of the browser
window) or as a specific size measured in pixels.
There are a few peculiarities related to these attributes, when you
use them with the <tr> and <td> tags that you should bear in mind.
Using the HEIGHT attribute in a particular <TD> or <TR> tag
overrides the HEIGHT specifications of the <TABLE> tag.
Using the HEIGHT/WIDTH attribute in a particular <TD> or <TH>
tag causes a height/width change in all the <TD> tags of that column.
In case two cells of the same column contain HEIGHT/WIDTH
attributes, then normally the browser uses the higher width specified.
Customising Margins
The attribute CELLPADDING specifies (in pixels) how much empty space
exists between items in the cells and the walls of the cells, a higher
value for this attribute making the cells larger, padding the cell.
The attribute CELLSPACING specifies (in pixels) the distance
between two adjacent cells. This is particularly useful when you use
the table tag to separate blocks of text. For instance you could use this
attribute to create a two column text.
You will notice that if you do not specify a cell padding, the table
border will stick to the edge of the contents of the table. Some examples
are given below in figure 9.12.
Figure 9.12 : The use of cell padding and cell spacing attributes
Nesting tables
Try placing two tables side by side on a web page. You will notice that
the <table> tag automatically sends the second table to the next line.
To get around this problem, we simply nest the two tables inside a
third table, a sort of border around the two tables, thus keeping them
on the same line adjacent to each other.
You create a table with one row and two columns and put in a table into
each of the two cells. See the code and the result in figure 9.14 below.
Nesting tables can also be used to create tables where each table
row has different cellpadding and cellspacing. Try this out.
Let us now examine the use of tables in our web page. Look at
figure 9.15. There are two distinct ways in which tables are used here.
The overall web page itself has a table like look. This table contains
two rows. While the first row has only one cell or column, the second,
containing the menu options has five cells. The third which constitutes
the text of the web page has two cells or columns.
The first table listing the contents has six rows or a single cell
each. This table is nested within the first column of the third row of
the main table.
The second listing the specifications and prices of hardware, is
nested in the second column. While the header row indicates the
types of information, the first column lists the type of hardware.
The third table in the third column of the third row of the main table
holds thumbnails of an image gallery. Each image is a hyperlink to a
larger version of the image and will open on another web page. We
will discuss the tags for this table in the section 9.5.10 below.
If you observe the source code of this page, you should be able to
identify the tags for these tables. Write down the tags for these tables.
Take care to ensure that each tag has its corresponding closing tag.
This is particularly necessary while nesting tables, rows or cells. Also
notice the use of various attributes and their values. Vary them and
observe the effect.
ON
Most of the websites you encounter would have one or more images. It
could be the use of a logo of the organisation, some design elements, a
background, an image gallery or even a photograph used for beautifying
the web page.
Images can be drawings, photographs, graphs, or even decorated
text saved as images. Keeping in view the need for small file sizes,
HTML supports jpg, gif, and png formats. But as we learnt earlier,
HTML produces a text file. Hence images are not placed inside the
file. A reference to the file is made and the image file accompanies
the text file.
We use the <img> tag to insert an image on the web page. This is
always used with the attribute SRC, which stands for the source of
the file (what is the image file and where is it located?). Typical
examples are :
In the first example, the image referred to lies in the same folder as
the html file. In the second example, the image is in a sub-folder called
images, which is in the same folder as the html file. This also brings
about an interesting option. The image file can be anywhere, as long
as we can define its exact location. The image can even be on a different
web site, residing on a server half way across the world. The tag would
look like :
Of course this assumes that the website and the image is available
on the remote website, when you are viewing your web page.
text, and then it goes back and fills in the image. If these attributes
are not specified, the browser has to load enough of the image to get
the dimensions before it can lay out the rest of the text, thereby slowing
the display of other page elements. To specify image height and width,
add the HEIGHT and WIDTH (in pixels) attributes in the <IMG> tag.
What happens if the height or width values are smaller or greater
than the image? Simple, the image gets cropped (cut) or stretched
(Figure 9.16). So, height or width should exactly match the actual image.
Aligning Images
By default the image is aligned to the left of the web page and the text
is aligned at the bottom most line of the image. To change this default
setting, HTML offers several image alignment options:
Three options vertically align the image with respect to a line of
text: align=top, align=bottom and align=middle
Two options align the image to the left or the right of the window
(with corresponding text wrap)
Look at figure 9.17 below.
Image Borders
The BORDER attribute of the <IMG> tag displays a border. You can
also control its thickness by specifying a value. The default value is
0, indicating no border. If you do not specify a border colour using the
bordercolor= attribute, then the colour specified in the <body> tag
will be used. If you have not done so, then the default colour, black
will be used.
Now let us look at our web page and look at how the image gallery was created.
Look at the source code for this table in figure 9.18. Nothing extraordinary. The
table has five rows with five cells each, all of them equally spaced.
What does this say? The HREF= attribute has a value which refers
to a page mywebpage.htm on the site mywebsite.com. As long as
this page actually exists on this site and the server hosting this site is
connected to the web, you will be able to call this page a click on the
link would display this page.
The World Wide Web uses an addressing scheme known as URL to
indicate the location of files on the web. URL stands for Uniform Resource
Locator (sometimes also called Universal Resource Locator), which is
the address of a document on the Internet. You will notice the URL for
your web page displayed in the address bar of your Web browser.
Hover your mouse cursor over a hyperlink. Notice that the cursor
changes shape into a pointed finger icon. At the same time, you will
see the address to which this hyperlink points in the status bar at the
bottom-left corner of the page.
Types of URLS
URLs are of two types, absolute URL and relative URL.
An absolute URL contains the complete address of a file on the
Internet. An absolute URL therefore refers to the hostname, folder
name and filename, and also the protocol (set of rules) it will use to
connect to the web page or file.
For example: http://www.ncert.nic.in/html/schoolcurriculum.htm
Notice, we keep referring to the file on the Internet. The website not
only hosts web pages, but also images, video, audio, documents, zipped
files or folders, and practically any type of digital file. Browsers mostly
interact with web pages, which are files of the html type. All other files
are downloaded on to your machine (or executed if it is a program).
A relative URL, on the other hand, is a shorter form, and points to
files on the same server or in the same folder. A relative URL contains
only the folder name and filename or just the filename if the web page
containing the link and the resource called are in the same folder.
For example: /html/school.htm
This URL refers to a file school.htm residing in a folder html. The
folder resides on the same site as the web page containing the link. We
could have written the complete address as
http://www.mywebsite.com/html/school.htm but the shorter form
is sufficient.
Types of hyperlinking
As we mentioned earlier, hyperlinks can be to a destination within the
same page, or to some other page. We could also use hyperlinks to
launch scripts or applications and perform other functions, for example,
we could launch a slide show, play a movie or even send an e-mail. Let
us examine the attributes for these actions.
External linking
This is perhaps the most common usage of hyper links. Page1 containing
the link hyperlinks to Page 2. And as we mentioned earlier, page 2 can
be on the same site or on a remote site.
The format is <A HREF=http://mywebsite.com/myfile.htm>link
to my file</A>. If the destination file, in this case myfile.htm, happens
to be a web page, then the browser handles it on its own. The new web
page is displayed.
If the destination file is let us say, a video, then the browser calls
upon a media player to help display the contents. We call such add
on software as plugins. Java scripts are also used in some cases.
Browsers can display text and images, but for all other media they
would require external support. So, you could have plugins to play
video, audio, animations, or scripts to play slide shows or even an
executable (.exe) program.
Be sure to have a video file named myvideo.wmv in the same directory
as the html file, or simply change the src attribute to point to the path
of the video file.
Let us review the attributes of the <embed> tag :
type= defines the type of embedded object youd like to use. This tag is
mandatory for Windows Media Player to be embedded in the web page;
pluginspage= this attribute is needed only if the user computer
does not have a Windows Media Player plugin; as you cannot be
sure, include it;
name= this attribute assigns a unique name to this embedded
object, which will allow you to place and access multiple embedded
objects (see the section on named anchors below);
autostart= defines whether or not the video should start playing
automatically when the page is loaded;
width= and height= defines the size in pixels of the Windows
Media Player embedded window. If you want the visitors to see the
video at its original resolution, omit the width and height attributes.
src refers to the source, it defines the path to the file you want to play.
Internal linking
As we mentioned earlier, the link could be to another part of the same
page. Typically, you would need this when you have a contents page
listing different sections of a document and the sections themselves,
all in the same web page.
You would require to mark particular sections of a page using a
reference marker. This is done using the NAME attribute. Let us look
at this example :
Code
Output
Contents
Chapter 1
Chapter 2
Introduction:
Text of Introduction
Chapter 1
Text of Chapter 1
Back to contents
Chapter 2
Text of Chapter 2
Back to contents
From the output above, you will notice that the tag pair and the
attribute <A NAME= > </A> and the tag pair and attribute <A HREF=
> </A> are converted to links. Let us examine what these links refer to.
A click on the links Chapter 1 or Chapter 2 leads to the beginning
of the respective chapters. The link at the bottom of each chapter Back
to contents will lead back to the contents list. The tag pair <A Name=
></A> is called a named anchor and is actually not visible on the web
page. This tag functions as the destination for the link. So, when you
click on the link Chapter 1, you are led to this anchor. Similarly, when
you click on the link Back to contents, you are led to the anchor for the
contents list.
The other tag pair, <A HREF= ></A> is similar to any other link,
but the destination reference is preceded by a hash (#). This hash
prompts the browser to look for a named anchor on the same page.
This technique of navigation within the page is very useful when
you wish to keep a document together and not split it into many different
web pages. Printing, or downloading this page will yield the entire
document in one piece. While it may look silly on short web pages, it is
certainly very useful if you have a very long web page and have to
frequently go back and forth or seek particular sections.
You can also use this technique when you wish to refer to a
particular section on a different web page. In this case, the hyperlink
will refer to a different web page and a named anchor on that web
page. See the example below :
The link refers to an anchor named section2 on a web page named
index.html.
Large images have big file sizes and take time to load. To overcome
this, we represent the image with a smaller image on the web page. We
refer to this as the thumbnail. So we would like the user to click on
this image to see the larger image. Thumbnails can be used to represent
not just images, but any resource. For instance, you may like a
photograph of the cover page of a book to represent the web page
containing the book.
The tags used in this case is a combination of the <A HREF=></
A> and the <IMG SRC=> tags. Look at this example:
You would have used the tag <IMG SRC=myphoto.jpg> to display
the picture. Enclosing this tag with the <A HREF=></A> tag, converts
this picture itself into a link. So a click on this link would lead you to a
new page, mywebpage.htm.
Notice, that it does not say anything about what the new page
contains. It simply links to a different page. In fact, this facet of HTML
allows it to hand over control to the next page, leaving that page to
handle resources relevant to that page.
E-mail links
If you wish someone to comment about your web page or the content
on it, or you wish to invite someone to contact you, an easy way of
doing so would be to put in your contact details (address or phone
numbers). An easier way would be to provide an e-mail link so that an
e-mail can be sent to you from right there. The tag to use is still the <A
HREF=></A>. See this example:
The mailto: part of the attribute launches your default mail client
(see figure 9.19 below). Of course, you should have configured your
mail client to send mails. If you usually use a browser based mail
programme like Hotmail, or Yahoo, or Gmail, you may not have
configured it. Typically, in a Windows environment, Outlook Express
is the default e-mail client, unless you have configured some other
mail client. So, this tag will be useful and serve the purpose only on
those machines, where an e-mail client is configured. Nevertheless, it
is a very useful and time saving tag attribute.
Code
Sending request to
a cgi program
ACTION=/cgi-bin/something.cgi
(relative url) or ACTION=http://
mywebsite.com/cgibin/something.cgi(absolute url)
Sending request
to a javascript
ACTION=javascript:SomeFunction()
Sending request to
an email address
ACTION=mailto:[email protected]
With the get method, the query or information along with relevant
codes is appended to the URL specified by the action attribute and this
new URL is sent to the processing agent. The get method should be
used when the form is idempotent (i.e., causes no side-effects). Many
database searches have no visible side-effects and make ideal
applications for the get method. Further the get method restricts the
input to ASCII characters.
So, if you searched for solar eclipse 2009 on mywebsite.com, the
form submitted would read http://www.mywebsite.com/
search?q=solar+eclipse+2009.
With the post method, the query or information is included in the
body of the form and sent to the processing agent. If the service
associated with the processing of a form causes side effects (for example,
if the form modifies a database or subscription to a service), the post
method should be used.
Form Elements
Having defined the action and the method, we define the format of the
information to be input and sent to the server. These can be in the
form of text entry fields, check boxes, radio selections, password entry
fields, form buttons, file upload fields, or image buttons. All these are
defined as attributes of the <INPUT> tag.
The <INPUT> tag can have several other attributes depending on
the value of the TYPE attribute. The type attribute specifies the type
of input we want from the user. It can be used to create the following
type of interface elements:
1. Text field
2. Password field
3. Radio button
4. Check box
5. Submit button
6. Reset button
7. Image button
8. Hidden field
The TYPE=TEXT attribute is a common form input field. It creates
a place wherein one line of information can be typed.
Radio buttons are used when the user is expected to select one and just one - option from a set of alternatives. The TYPE=RADIO
specifies a set of controls that are linked so that only one radio button
among each set is selected at a time; if the user clicks one radio button,
the others in the set are automatically de-selected. All options for the
radio button should have the same name. The value sent by the form
is the value of the radio button that was last selected. Adding the
option CHECKED to one of the buttons in a set will make that button
pre-selected when the page loads, a kind of default value. Look at the
example below:
Check boxes are used to allow the user to select multiple options
from a set of alternatives. A check box is thus not affected by other
buttons, so it is possible to have more than one in a group checked at
a time. They can be created using the TYPE=CHECKBOX attribute.
Notice that unlike a radio button, every check box has a unique name.
Clicking it will place a check mark (X or ) and clicking it again will
remove the mark. The value sent in the web form is the value of the
check box if it was selected; otherwise the value will be empty. You
may add the option CHECKED to a particular check box to define it as
the default value.
The TYPE=SUBMIT creates a submit button on the form and the
TYPE=RESET creates a reset button. The Submit button tells the
web browser to gather up all the selections, values, and entered text in
the form elements and dispatch it off to the destination defined in the
ACTION part of the <FORM> tag. The Reset button restores the form
to its default state.
The submit or the reset button has a typical shape and size, which
may not be in harmony with the rest of the look and feel of the web
page. Hence you may prefer to use an image instead using the
TYPE=image attribute. When a user clicks an image button the
P P P
The File field allows users to upload files. The user can submit any
information like picture, a spreadsheet, a scanned document or a wordprocessor document after verifying that the server on which the form
will be processed supports file upload. The browser displays a BROWSE
button next to a text box that lets the user select a field from their
computers storage to use as the value of the file input element.
Typically, you would have encountered this option when attaching files
to your email messages.
The output produced will be:
A hidden field is similar to text field with one major difference. The
hidden field does not show on the page. Therefore the user cannot type
anything in the hidden field. The TYPE=hidden attribute is used to
specify information for the receiving program or function that is not
visible to the user and that the user may not change. This information
is usually required by the program or function in order to process
other information.
The hidden field does not show, but still, when the form is submitted
the hidden field is sent with it. In the above example the hidden field
would tell the program that handles the form, that the users preferred
language is English. Bilingual or multilingual sites, for example, can
then switch to the correct language.
The above listing will display a drop down list since the size attribute
is not specified:
and colours, and the content of the web page are all put together. Not
only did this make web pages slow to load, but also made it difficult to
change. It required the graphic designer, who was mostly concerned
with the look and feel of the web page, the subject expert who was
interested in the content of the web page and the programmer, who
handled the html code to work closely together. Each time a new page
had to be made, all the three had to get together again.
Developing dynamic sites with thousands of different pages would
have been very difficult to make and manage using such methods. An
interesting technology has allowed us to separate the design, the
content and the programming elements.
This technology, known as cascading style sheets allows the placing
of all the design elements colours, images, positioning, fonts, sizes
and layouts to be placed in a separate file, the style sheet file. The
content is placed in a text file or as records of a database. The html
code along with other advanced code for supporting dynamic features
is placed in the web page. The style sheet and the web page together
function as a template, a container with predefined style elements.
When the user calls for a page, the content, the style and the code are
combined dynamically to generate a web page.
The use of cascading style sheets and databases now allows you to
concentrate on content development. Once developed, the style sheets,
the database and the web page code will remain fixed, unless you wish
to modify it. New content gets populated in to the database, making it
very easy for web site content to be renewed frequently.
Summary
One of the major applications of the Internet is the World Wide Web (www).
The web can be thought of as an interconnected set of documents, images, audio, video or
software files.
The web uses the Hyper Text Markup Language to request and serve web pages and
programs. Browsers are designed to read and interpret HTML.
HTML consists of tags; the general format for a HTML tag is <tag_name>affected text or
image</tag_name>
Tags have different attributes and attributes take different values. Together, they extend
the scope and functionality of HTML tags.
You will need a HTML editor to write your code and a browser to test your web page;
browsers differ in the way they interpret specific tags; it is therefore advisable to test your
web page on different popular browsers.
The basic structure of a web page is
The code that goes into the <head></head> tag pair is not displayed by the browser; the
title tag is an exception; it is displayed in the title bar of the browser window.
All references to scripts, fonts, meta data are made in the head section.
All elements of the web page visible in the browser window go into the <body></body> tag.
Tags associated with size, colour, font are used to highlight text elements on a web page;
You can also highlight text using bold, italic or underline.
Text can be organised into paragraphs and paragraphs or lines of text can be separated
from each other with the use of <p></p> and <br> tags.
Lists can be prepared and presented using the ordered or unordered list tags; list items
can be numbered in different ways using the type attribute.
The <table></table> tags along with its associated tags and attributes is used in two
ways; to separate different blocks of content and to present content in the form of tables.
Tables consist of rows and cells; they can be structured and beautified using backgrounds,
images, controlling their sizes and contents; tables can be nested within other tables.
Images, audio and video files can be embedded in web pages. While browsers display images
on their own, they require the support of media plugins to play back audio and video files.
Hyperlinks are the most powerful feature of the web. Hyperlinks allow us to link two
resources. The resources can be on the same or a different page, on the same storage or
on a computer located half way across the world.
Hyperlinks are achieved using the <a href=source of resource>link</a> tags.
Forms can be used to submit information to, place a request on and retrieve information
from the server. This extends the interactivity of web pages.
Linking web pages to databases have enabled content on request, whereby servers
respond to specific queries of users and dynamically generate web pages containing
responses to the queries.
EXERCISES
SHORT ANSWER TYPE QUESTIONS
1. Identify and name the following:
(a) One physical tag and an equivalent logical tag used for making the text
bold.
(b) One physical tag and an equivalent logical tag used for making the text
appear in italics.
(c) A Windows accessory used as a text editor for creating HTML documents.
(d) Two possible extensions of an HTML file.
(e) A tag used for inserting section breaks.
(f) A tag used for displaying headings in a web page.
(g) Different tags necessary for creating tables.
(h) Tags used for creating framesets.
(i) Mandatory attribute of the <A> tag.
(j) An attribute of the <A> tag used to specify name of the frame in which the
linked file is to open.
(k) Two attributes of the <FRAME> tag used to control the amount of white
space between the frame borders and the contents of the frame.
(b)
(i)
(j)
(k)
(l)
(m)
b)
Activities
1. Write HTML code to display the names of any 5 subjects on different lines (use <BR>
tags). Change the <BR> tags to <P> tags and notice the change. Next try to display the
names with a number in front of them. Finally, change the numbers to bullets.
2. Write HTML code to illustrate the usage of nesting of tags. Change the nesting order and
see if it makes any difference in the output.
3. Write the HTML code for the following web page:
List of Subjects
1. SCIENCE
(a) BIOLOGY
(i) BOTANY
(ii) ZOOLOGY
(b) CHEMISTRY
(i) ORGANIC
(ii) INORGANIC
(iii) PHYSICAL
(c) PHYSICS
2. SOCIAL STUDIES
(a) GEOGRAPHY
(b) CIVICS
(c) HISTORY
(d) ECONOMICS
4. Play around with the horizontal lines by typing the following code in a notepad file and
viewing the output. Try out other variations by changing the size, align and color options.
5. Write the HTML code to design the following web page:
States of Matter
There are three states of matter:
Solids Example: Pencil
Liquids Example: Water
Gases Example: Air
6. Write the HTML code to design a website (at least two pages) about your favourite Pastime
with the following properties:
(i) Each page should have appropriate titles.
(ii) The headings should scroll on the page.
(iii) Insert an appropriate image as a background of the web pages.
(iv) The heading of the page should be in RED colour and style Arial. It should be
underlined and right aligned.
(v) The first page should have the information in paragraphs each of which is in different
colour and alignment.
( vi) The second page should contain a list of the famous tourist spots in that area.
7. Write the HTML code to produce the output shown below with the specified numbering.
8. Write the HTML code to generate the output shown below (assume that the name of the
file is flower.jpg).
9. Your best friend has created a web page with the url: www.tipod.com/personal/
cooldude.html . You now want to link to this web page, when you click on the photograph
of your friend which you have placed on your web page. Assume that the name of file
containing your friends photograph is c:\mypictures\myfriend.jpg.
Average
11. Write the HTML code to generate the following output (assume the names of the images
as hill.jpg, sea.jpg and water.jpg respectively).
12. Your schools web address is www.littlebuds.com. You want to create a link to this website
from your web page. Write the HTML code to do this?
Second.html
Third.html
Fourth.html
(b)
B.html
A.html
C.html
D.html
E.html
(c)
A.html
B.html
D.html
C.html
E.html
CLIENT-SIDE
SCRIPTING USING
JAVASCRIPT
Objectives
After completing this Chapter, the
student will be able to:
define JavaScript,
Brendan Eich
Creator of JavaScript
10
Introduction
In Chapter 9 we learnt how to create web pages
using HTML. The HTML documents consist of many
tags, which tell the browser, how to display the
text or graphics. Also, we have learnt to create
static web pages; which are not interactive. To
make the HTML document interactive and
dynamic, there is a need to include some special
codes (scripts) along with HTML. One such
scripting language is JavaScript.
In this Chapter, we will learn about basics of
JavaScript and how to add dynamic effects in web
pages using expression, operators, popup boxes,
conversion functions, conditional statements,
looping statements, object manipulation
statements and JavaScript functions.
Web Browsers
JavaScript 1.0
JavaScript 1.3
JavaScript 1.5
JavaScript 1.6
JavaScript 1.7
JavaScript 1.8
10.2.1 NODE
Node is a component or terminal connected to a network. The
components like laptops, PDAs, Internet enabled mobiles etc., can be
considered as node in a computer network.
10.2.2 CLIENT
It is a node computer that establishes connection with the server,
collects data from the user, sends it to the server, receives information
from the server and presents it to the user.
10.2.3 S ERVER
In the context of client-server model, server is the counter part of
client. It is a computer that serves queries from the client. The programs
which respond to the request of clients are known as server
applications. The computer designed to run server application is known
as server machine. Web server, database server and mail server are
some examples of servers.
The Client Server Model is an architecture of computer network
where client and server interact by means of a network (Figure 10.1).
Client gathers data from the user as input and sends request to the
server. Server processes the request and sends the requested
information to the client. Railway reservation system, online banking
and online gaming are examples of client-server model.
Indicates starting
JavaScript Code
of
Indicates ending
JavaScript Code
of
JavaScript statement(s);
</SCRIPT>
Value
Description
Type
text/javascript
text/ecmascript
text/vbscript
Language
Javascript vbscript
Src
URL
Note : You notice that the code does not fit into single line. So, we used to
indicate that the code is continued and while inputting it you need not to type it.
To run the above program, type program code given above using
any text editor like Notepad, Wordpad and save it as <file
name>.htm (e.g. abc.htm). Open this file by using any browser
application (i.e. Internet Explorer, Mozilla Firefox, Opera etc.).
Figure 10.3
Output
Figure 10.4
10.4.1 C OMMENTS
Comments are the statements that are always ignored by the interpreter.
They are used to give remarks to the statement making it more readable
and understandable to other programmers. There are two types of
comments :
- Single line comment using double-slash (//).
- Multiple lines comment using /* and */ .
For example :
// This is a single-line comment.
/* This is a multiple-line comment.
It can be of any length.
*/
10.4.2 LITERALS
Literals refer to the constant values, which are used directly in
JavaScript code. For example:
a=10;
b=5.7;
document.write(Welcome);
In above statements 10, 5.7, Welcome are literals.
10.4.3 IDENTIFIERS
Identifiers refer to the name of variables, functions, arrays, etc. created
by the programmer. It may be any sequence of characters in uppercase
and lowercase letters including numbers or underscore and dollar sign.
An identifier must not begin with a number and cannot have same
name as any of the keywords of the JavaScript.
Some valid identifiers are :
RollNo
bus_fee
_vp
$amt
Some invalid identifiers are :
to day
17nov
%age
10.4.5 VARIABLES
A variable is an identifier that can store values. These values can be
changed during the execution of script. Once a value is stored in a
variable it can be accessed using the variable name. Variable
declaration is not compulsory, though it is a good practice to use variable
declaration. Keyword var is used to declare a variable.
Syntax
var var-name [= value] [..., var-name [= value] ]
Example
var name = Sachin;
document.write(name);
// Prints Sachin
A JavaScript variable can hold a value of any data type. For example :
i = 7;
document.write(i);
// prints 7
i = seven;
document.write(i);
// prints seven
_sumof
Some invalid variable names
10_numbers
rate%
my name
10.5.1 NUMBER
The number variable holds any type of number, either an integer or a
real number. Some examples of numbers are:
29, -43, 3.40, 3.4323
10.5.2 STRING
A string is a collection of letters, digits, punctuation characters, and
so on. A string literal is enclosed within single quotes or double quotes
(or ). Examples of string literals are:
welcome, 7.86 , wouldnt you exit now, country=India
Escape Sequence
\b
Backspace
\n
New line
\r
Carriage return
\t
Tab
Single quote ()
Double quote ()
\\
Backslash (\)
Example :
t
Here, two types of escape characters are used \ and \ in this
example.
Output
Abhinav said, Earth doesnt revolve round the sun. But teacher
corrected him.
10.5.4 ARRAYS
An array is a collection of data values of same types having a common
name. Each data element in array is referenced by its position in the
array also called its index number. Individual array elements can be
referenced by the array name followed by the pair of square brackets
having its index number. The index number starts with zero in
JavaScript i.e. the first element in JavaScript has it index value as 0,
second has its index value as 1 and so on. An array can be declared in
any of the following ways :
var a = new a( );
var x = [ ];
var m = [2,4,sun];
An array is initialised with the specified values as its elements,
and its length is set to the number of arguments specified.
Example This creates an array name games with three elements.
games = [Hockey, Cricket, Football];
We can also store different types of values in an array.
For example :
var arr = new Array();
// creation of an array
arr[0] =JAVASCIPT;
arr[1] = 49.5;
arr[2] = true;
10.6 OBJECTS
JavaScript is an object based scripting language. It allows us to
define our own objects and make our own variable types. It also
offers a set of predefined objects. The tables, forms, buttons, images,
or links on our web page are examples of objects. The values
associated with object are properties and the actions that can perform
on objects are methods or behaviour. Property associated to an object
can be accessed as follows:
ObjectName.PropertyName
Now we will study, some of the predefined objects in JavaScript.
The Document object is one of the parts of the Window object. It can be
accessed through the window.document property. The document object
represents a HTML document and it allows one to access all the elements
in a HTML document. For example: title of current document can be
accessed by document.title property.
Purposes
Title
bgColor
fgColor
linkColor
alinkColor
vlinkColor
height
width
Forms
Images
URL
Location
Methods
Purposes
open()
write()
writeln()
close()
Milliseconds
dateString
yr_num, mo_num,day_num
t t
tt
t
t
Methods to read date values
We can use the get methods to get values from a Date object. Here are
some get methods that returns some value according to local time :
getDate( )
getDay( )
getFullYear( )
getHours( )
getMinutes( )
getMonth( )
getSeconds( )
getTime( )
getYear( )
t t
tttt
t t
t t
P Ptt t
t tt
Description
Math.PI
Math.E
Math.LN2
Math.LN10
SQRT1_2
SQRT2
Methods
+Description
pow(x, p)
abs(x)
exp(x)
log(x)
sqrt(x)
random()
ceil(x)
Returns X P
Returns absolute value of x.
Returns ex
Returns the natural logarithm of x.
Returns the square root of x.
Returns a random number between 0 and 1.
Returns the smallest integer greater than or equal
to x.
Returns the largest integer less than or equal to
x.
Returns the lesser of x and y.
Returns the larger of x and y.
Rounds x up or down to the nearest integer.
Returns the sin of x, where x is in radians.
Returns the cosine of x, where x is in radians.
Returns the tan of x, where x is in radians.
floor(x)
min(x, y)
max(x, y)
round(x)
sin(x)
cos(x)
tan(x)
Figure 10.8
- (Subtraction)
/ (Division)
++ (Increment by 1)
Examples
Example
is equivalent to
+=
=
*=
/=
%=
a+=b
a=b
a*=b
a/=b
a%=b
a =a+b
a=a b
a =a*b
a =a/b
a=a%b
Operator
Description
Example
==
!=
>
<
<=
>=
is
is
is
is
is
is
4
4
8
8
8
8
equal to
not equal to
greater than
less than
less than or equal to
greater than or equal to
= = 8 returns false
! = 8 returns true
> 4 returns true
> 4 returns false
< = 4 returns false
> = 4 returns true
Output
&& (AND)
| | (OR)
(NOT)
Output
Good + Morning
5 + 10
Lucky + 7
4 + 7 + Delhi
Mumbai + 0 +0+ 7
GoodMorning
510
Lucky7
11Delhi
Mumbai007
Syntax
If (condition) is true, the value v_1 is assigned to the variable,
otherwise, it assigns the value v_2 to the variable.
For example
ss
This statement assigns the value adult to the variable status if
age is eighteen or more. Otherwise, it assigns the value minor to
status.
New
new operator is used to create an instance and allocate memory to a
user-defined or predefined object types.
Syntax
ObjectName = new objectType ( param1 [,param2] ...[,paramN])
Example
sss
r
Delete
The delete operator de-allocates (releases) the memory space that was
allocated using the new operator by deleting an object, an objects
property or an element from an array.
The syntax is
s s
s
s s s
s
s s
s
s s
s
this
JavaScript supports this operator. The word this refers to the current
object. It is like a pointer to the current object.
The syntax is
t
Example
Use of this operator to validate the age. Here input is provided through
the text box.
t
tt
Figure 10.9
Description
Priority
*
/
%
Multiplication
Division
Modulus
Highest
Addition
Subtraction
<
<=
>
>=
Less than
Less than equal to
Greater than
Greater than equal to
==
!=
Equality
Not equality
&&
Logical AND
||
Logical OR
?:
Conditional
=
+=
=
*=
/=
%=
,
Assignment Operators
Comma
Lowest
10.8.1 ALERT B OX
Alert( ) method of window object creates a small dialog box with a
short text message and OK command button called alert box. Alert
box contains an icon indicating a warning.
Syntax
The word window is optional.
Example
Output
An alert box is used if we want
to display some information to the
user. When an alert box appears,
the user needs to click OK button
to proceed.
10.8.2 CONFIRM B OX
Confirm box is used if we want the user to verify and confirm the
information. The user will have to click either OK or Cancel buttons.
Syntax
Example
Output
Confirm box returns a Boolean value.
If the user clicks on OK, it returns
true. If the user clicks on Cancel, it
returns false.
Example
Output
A prompt box returns input string value
when the user clicks OK. If the user
clicks Cancel, it returns null value.
if ( condition )
{
.. statement(s) to be executed if (condition) is true
}
Figure 10.10 : Flowchart for if statement
if else statement
This statement is an extension of the simple if statement. It permits
one of two statement or group of statements depending upon the
logical test.
The Syntax is
if ( condition )
{
True statement(s)
}
else
{
False statement(s)
}
Figure 10.11: Flowchart for if else statement
.
.
else
{
code to be executed if any of the conditions is not true
}
t
Figure 10.12 : Flowchart for if else if else statement
Output
{
case label1 : //executes when value
of exp. evaluates to label
statements;
break;
case label2 :
statements;
break;
...
default : statements;
}
Program 10.5 : To compute the day of week (in words) while you input
the date within prompt dialog box.
The value of this expression is then compared with the values for
each case in the switch structure. If there is a match, the block of code
associated with that case is executed. If no case is matched, the
statement in default will be executed. Use break to prevent the code
from running into the next case automatically. There is no need to use
break within the default case.
When you press OK button, we will get the output (Figure 10.14) :
For
The for loop consists of three optional expressions separated by
semicolon, followed by a block of statements executed in the loop. Loop
statements executed repeatedly again and again until the condition is
false. The for loop is used when we know in advance how many times
the script code should run.
The Syntax is
for([initial-expression]; [condition]; [increment-expression])
{
statements
}
Parameters
Initial-expression
Condition
Incr.-expression
Examples
The following for statement declares variable i and initialising it to 1.
It checks that i is less than 20, performs the two succeeding statements,
and increments i by 2 after each pass through the loop.
While
The while loop statement is simpler than the for loop. It consists of a
condition and block statement. The condition is evaluated before each
pass through the loop. If the condition is true then it executes block
statement.
The Syntax is
while (condition)
{
statements
}
Example : The following while loop gives same output as for loop in
previous example.
Do...While
The do...while loop is much like a while loop. It will repeat the loop
until the specified condition is false. This loop will always be executed
at least once, even if the condition is false, because the block of
statements is executed before the condition is tested. In this loop
statement, curly braces are optional.
The Syntax is
do
{
statements
}
while (condition);
Example : The following dowhile loop gives same output as while loop
in previous example.
Condition lies between the parentheses after the block of statements
with while keyword.
10.10.3 LABEL
A label is an identifier followed by a colon that can be helpful in directing
the flow of program.
The Syntax is
label: statement
The value of label may be any JavaScript identifier. The statement
that you identify with a label may be any statement.
Example
In this example, the label whileloop identifies a while loop.
10.10.4 BREAK
Break statement is used to exit from the innermost loop, switch
statement, or from the statement named by label. It terminates the
current loop and transfers control to the statement following the
terminated loop.
The Syntax is
break [label]
The break statement includes an optional label that allows the
control to exit out of a labeled statement.
Example : The following program segment has a break statement that
terminates the while loop when it is equal to 3.
var i = 0;
while (i < 6)
{
if (i == 3)
break;
i++;
}
document.write(i);
10.10.5 CONTINUE
The Syntax is
continue [label]
The continue statement does not terminate the loop. Instead, in a
while loop, it jumps back to the condition and in a for loop, it jumps to
the update expression. The continue statement can include an optional
label that allows the program to terminate a labeled statement and
continue to the specified labeled statement.
Example
A program to input 50 elements using prompt() and then compute sum
of marks more than 40 using continue statement.
10.11.1 FORIN
The forin statement iterates a specified variable over all the properties
of an object.
The Syntax is
for (<variable> in <object>)
{
statements
}
The body of the forin statement is executed once for each property
of an object. Before the loop statement is executed, the name of one
of the objects property is assigned to variable, as a string. We can
use this variable to look up the value of the objects property with
the [ ] operator.
Example : To print the name and value of each property of a Book object.
r P r r P P r r P
Output
10.11.2 WITH
With statement saves a lot of typing when properties of same object
have to be accessed. For example, it is common to work with deeply
nested object hierarchies. Sometimes we have to type expressions like
this one to access elements of a HTML form :
Frames[1].document.forms[0].fname.value
Examples
The following script illustrates the use of with statement. Here two
object Math and document are default objects. The statements following
the with statement along with Math object refer to the PI property and
the cos and sin methods, without specifying an object. Same way the
statement following the with statement along with document object
refer to the write method, without specifying the object. JavaScript
assumes the Math and document object for these references.
Output
We have learnt how to create simple functions. The best place for a
function definition is within the <HEAD> section of the HTML document,
because the statements in this section are executed first, this ensures
that function is defined before it is used.
Example : Using a function within the HEAD section of a HTML
document.
When the user clicks the button, the program automatically calls
the calc() function.
Output
rr
rr rr
boolean
break
byte
case
catch
char
class
const
continue
debugger
default
delete
do
double
else
enum
export
extends
false
final
finally
float
for
function
goto
if
implements
import
in
instanceof
int
interface
long
native
new
null
package
private
protected
public
return
short
static
super
switch
synchronized
this
throw
throws
transient
true
try
typeof
var
void
volatile
while
with
Summary
JavaScript is a platform independent object-based scripting language.
Client-side JavaScript is the name given to JavaScript code that is executed by a web
browser on client machine.
JavaScript is a case-sensitive language and all the statements are written in lower case.
JavaScript allows omitting semicolon when statements are placed in separate lines. If
we combine statements into a single line, we must use semicolon to separate them.
document.write is a standard JavaScript command for producing output to a document
window.
Literals refer to the constant values that are used directly in a program code.
A variable is a container of values or string. The values stored in a variable can be
accessed using the variable name.
JavaScript supports three primitive data types: number, string and boolean. JavaScript
allows two composite data types: objects and arrays.
Expression is combination of operators and literals or variable names.
The increment and decrement operators act on only one operand. These are used for
increasing or decreasing the value of a variable by 1.
An assignment is a basic operator, which assigns the value of its right operand to its left
operand. This operator is represented by an equal sign(=).
Relational operators are used to compare the values of operands and it returns Boolean
value based on the condition.
JavaScript has three logical operators:
&& (AND) ,
The + operator is also used to concatenate two string operands. It gives priority to string
operands over numeric operands.
Conditional operator ( ? : ) is also called ternary operator.
new operator is used to create an instance of a user-defined object type or one of the
predefined object types.
The delete operator is used to de-allocate the memory space.
The in operator returns true, if the specified property/index exists in the specified object.
Alert box is a dialog box with a text message and OK button.
Confirm box is a box meant to verify or accept some information, the user have to click
either OK or Cancel buttons to proceed.
Prompt box allows us to gather users input with the help of text field.
Block statement combines two or more statements into a one statement. Block statements
are commonly used with conditional and looping statements.
An if statement is used to execute a statement or a block of statements on the basis of
condition.
A switch statement in JavaScript is used to perform different actions based on different
conditions. It can be a replacement for multiple if else if statement.
Loop statements tell JavaScript interpreter to execute same statements again and again
until a specified condition is met.
The for loop consists of three optional expressions. It executes block statement repeatedly
again and again until the condition is false.
The while loop statement is simpler than for loop. It repeats block statement again and
again until the specified condition is false.
Unlike while loop, dowhile loop always executes a block of code at least once.
Instead of exiting a loop, continue statement skips the statement following it and restarts
a loop in a new iteration.
The forin statement iterates a specified variable over all the properties of an object.
The with statement establishes the default object for a set of statements.
Function is a named unit for the group of JavaScript statements. If a user needs to send
values to a function, the values are enclosed in the parentheses after the function name
and sent as a comma-separated list of arguments when function is called.
The return statement is used to return a value from a function. A variable using assignment
operator can hold the returned value.
A function may be nested inside another function definition.
EXERCISES
SHORT ANSWER T YPE QUESTIONS
1. Is it possible to write programs for standalone applications in JavaScript?
2. Where should we use semicolon in the statements? Is it mandatory?
3. Differentiate between client-side and server-side JavaScript?
4. What is the purpose of document.write() in JavaScript code?
5. What are the invalid variable names in following? Explain with reasons.
My_Name, number10, $100, fathers name, marks%
6. What are reserved words? Can we use reserved words as identifiers?
7. What do you mean by literals?
8. What are the data types in JavaScript?
9. What is the purpose of var statement?
10. Why strings are enclosed within the single or double quotes?
11. Write JavaScript code that displays the following:
He said, Mahatma Gandhi was a non-violent soldier of India.
12. Can we use different data type values in a single array?
13. Write a statement to assign numeric values 65, 75, 80, 87, 90 to an array
named stumarks.
14. Are the null and zero have similar values?
15. What are operators? What is the significance of an operator?
16. What type of a value a prompt()method returns?
17. Write the equivalent JavaScript statements for the following:
(a)Area = 3.14r2
(b)KE = mv2
18. What will be the value of variable r?
var r = 45 % 7;
19. What will be the value of variable r?
var a = 4;
var b = 7;
var c = NCERT;
r = a + b + c;
20. The == operator is not the same as the assignment operator =. (True or False).
21. Find the value of variable total ?
total = (360 * 5) + ((40 / 8) - 9) - ((14 * 6) / 2);
3. Write a program to find the greatest number among three given numbers?
4. What happens when the following JavaScript code is executed?
var get_res = confirm(Did you like this chapter?);
if (get_res == true)
alert(Okay! Lets go to the next!);
5. What will be the output if variable marks is 75?
if (marks >= 80)
{
alert(Excellent!);
}
else if (marks >= 60 && marks < 80)
{
alert(Good!);
}
else if (marks > 50 && marks < 60)
{
alert(Average!);
}
else
{
alert(Improve yourself !);
}
6. Write a program using switch statement to print word equivalent of a number
from 0 to 9, e.g. 3 should be displayed as Three.
7. Write a statement that displays an alert box which looks like this :
8. Write a program to print the following
output using for loops.
1
22
333
4444
9. How many times will the following for loop
be executed?
for (a = 0; a <= 10; a = a + 2)
{
... statements ...
}
10. What will be the final value of the variable sum?
s
11. What will be displayed in the alert box at the end of script execution?
12. Write a program to calculate the average of 5 numbers entered by the visitor
through a prompt?
13. If the value of variable num is 30, how many times will the following while loop
be executed?
14. Write a program to find the reverse of a number (i.e. reverse of 123 is 321)
15. Write a program to convert a decimal number into a binary number.
16. Write a program to check whether a number is palindrome or not. A number is
palindrome if it is equal to its reverse number.
17. Using continue display the odd numbers between 1 to 20.
18. Write a program to find sum of digits of a number, e.g. 453 results 4+5+3=12.
19. Write a program to generate prime numbers up to a specific limit.
20. What will be the output of the following JavaScript code?
22. Write a program using while statement to find out the sum of first n numbers.
(iii) while
(iv) switch
10. What will be value of sum after execution of the statement?
for(i=1, sum=0; i<=5; i++) sum+=i;
(i) 13
(ii) 15
(iii) 25
(iv) Error in statement.
11. Which of the loop executes a block of code at least once?
(i) while
(ii) for
(iii) do...while
(iv) for/in
12. Which of the following loop statement is used to iterate a specified variable
over all the properties of an object?
(i) for
(ii) dowhile
(iii) for/in
(iv) none of these
Activities
Write an HTML document using JavaScript code, which displays your name, class and
name of the school.
Write an HTML document using JavaScript to change backgrounds colour in your web
page randomly. (Hint: use document.bgcolor property and Math.random() function.)
Write a program to check whether the user is eligible to cast the vote. The user must
check following two conditions for casting the vote:
(a) the age should be equal to or greater than 18 years and
(b) the nationality should be Indian.
Write a simple Quiz program that asks the user 5 questions. Alert about answers of the
questions and give the user a score at the end of the Quiz.
Write an HTML document using JavaScript code to validate the form in your website.
References
JavaScript The definitive Guide - David Flanagan, OREILLY
SAMS Teach Yourself JavaScript in 24 hours Michael Moncur, Sams Publishing
JavaScript A Beginners Guide John Pollock, McGraw-Hill.
http://www.webreference.com/programming/javascript
http:// www.webdevelopersnotes.com/tutorials/javascript
http://www.javascriptkit.com
http://www.w3schools.com/js
http://sun.com
http://www.mozilla.org
PROJECT BASED
LEARNING
Objectives
After completing this Chapter, the
student will be able to:
Know about project and project
based learning
! explore the possibilities of
executing a project,
! experience the concept of
learning by doing,
! seek solutions to problems,
using CCT tools.
Understand the various processes
involved in project based learning
and the importance of team work
in project based learning
! develop projects for various real
life situations,
! work in realistic contextualised
problem-solving environments,
! realise the success of a project
by experiencing the desired
output.
Apply knowledge and
understanding of project based
learning processes in new situations
! improve communication skills,
! enhance self-confidence,
! appreciate that a project can be
executed in different ways,
! build up teamwork and
leadership skills.
11
Introduction
Project based learning gives a thorough practical
exposure to a problem upon which the project is
based. Projects are developed generally in groups
where students can learn various things such
as working together, problem solving, decision
making, and investigating activities. Project
based learning involves the steps such as
analysing the problem, formulating the problem
into small modules, applying the mechanism or
method to solve each module and then
integrating the solution of all the modules to
arrive at the complete solution of the problem.
To solve a problem it is required that those who
work on it gather the relevant data and process
it by applying a particular method. Data may be
collected as per the requirement of the project
in a particular format. All the team members
should be associated to accomplish the task.
After collecting data, it should be processed to
solve the problem. The results should be reported
in a predetermined format.
t t
t
t
11.2 TEAMWORK
Many real life tasks are very complex and require a lot of people to
contribute in achieving them. An effort made by many people together
in order to accomplish a task is called teamwork.
For example, in many sports, there is a team of players. These
players play together to win a match. Take an example of a cricket
team. We find that even if a bowler bowls a good ball but if the fielder
cannot take a catch then a wicket cannot be taken. So, in order to take
a catch we require efforts of a bowler and also of fielders. To win a
cricket match, contributions from all the team members in all the
three areas batting, bowling and fielding are required.
11.2.1 COMPONENTS
OF
TEAMWORK
Listen to Others
It is necessary to understand the ideas of others while executing a job
together. This can be achieved when the team members listen to each
other in group meetings and follow steps that are agreed upon.
Help Others
A helping hand from every member is a key to success. Sometimes
help from people who are not a part of the team is also obtained in
order to accomplish a job.
Participate
Guidelines
Make a group of students to undertake a project on Producing School
Magazine. This group should be divided further into several
subgroups of 2-3 students to carry out the work on similar lines as
mentioned below:
(a) Task force : This group should be involved in motivating the students
for writing and submitting the material for the school magazine.
(b) Students Articles : This group should collect the articles submitted
by students on areas of their interest. Articles may also include
quiz, humour, puzzles, and poems, etc.
(c) Sports Section : This project team should collect all the information
regarding the sports activities of the school like any zonal or district
level games, team members who took part, etc.
(d) Achievements in the field of Academic/Cultural activities : This
team should collect materials on the cultural and academic events
of the school.
(e) Illustrations : This group should create the illustrations, drawings,
etc. for making the Magazine more attractive and informative.
(f) Editing and layouts for printing : Editorial group should confirm
that the articles are original writings of the students. After
verification, the editorial group may compile all the collaborative
works done by the rest of the groups and should create a layout on
the computer. After creating the layouts the editing groups should
show their layout to the teacher under whose supervision the
project is going on.
After the layout has been finalised the magazine should be
printed and can be distributed among the students and teachers
of the school.
Outcome
The School Magazine.
The goal of the project is to help and create a monitoring report for the
Pulse Polio Program in your region (Figure 11.3). The group should
work to promote the Polio Eradication Movement taken up by the
Government of India.
Guidelines
Let us create a group of 810 students. This group should be divided
further into sub-groups of 23 students to carry out a specific work
each covering different regions.
(a) Task force : The students in this group should contact the PulsePolio Programme coordinators at the pulse polio centre in their
locality.
(b) Motivation group : This group should create digital posters on polio
vaccination that can be used to promote pulse-polio awareness
among people of their area.
(c) Data collection : After the Pulse Polio Programme scheduled for
the month they should collect the data that how many children
have been vaccinated and how many are still remaining in their
locality.
(d) Report generation : The chart representing the data should be
drawn using appropriate computer software.
The data of polio vaccination can be recorded for the whole year.
Outcome
The Pulse Polio Report highlighting the status of Polio Eradication
Programme in your village/town created using some presentation
software such as PowerPoint or Impress.
11.3.3 ROBOTICS
Project Title : Application of Robots in different fields
Description
The purpose of the project is to prepare a report on uses of robots
figure 11.4 in different fields. It will also help students to realise
the extent of automation and efficiency accomplished by robots in
various fields of industry.
Guidelines
Form a group of 810 students for the project. This group should be
divided further into subgroups of 23 students to carry out specific
tasks on the similar lines as mentioned below :
(a) One subgroup should collect the information about different types
of robots through websites or otherwise.
(b) Another subgroup should collect the information on various
industries who are using specialised robots in their manufacturing
units and to suggest the most suitable site for visit.
(c) Third subgroup should prepare a report on various functions/tasks
performed by robots in the manufacturing unit.
(d) Fourth subgroup should prepare a module showing advantages of
using robots.
Outcome
Guidelines
(i) Decide a group of students from whom data is to be collected. A
group of 2-3 students can collect data of 20 students.
(ii) Set the format of data to be collected by consulting a doctor. Note
some useful information such as height, weight, food habits and
exercise habits etc.
8 to 10 PM
10 to 12 PM
Activity
Outcome
Report on data related to health of students.
Description
The aim of the project is to organise the event with collaboration of
students and using CCT tools (Figure 11.6).
(a) Identification of Participants
The participants would be students of class 12th, class 11th, teachers,
chief guest and special invitees. Among the participants, class 11th
students are key members who will be organising the event. Class 12th
students, teachers, chief guest and special invitees constitute the
audience. The role of class 11th students, who are arranging the event,
is more proactive than others. The first task is to get the list of students
and teachers. One way of getting the names of the students of class
11th and 12 th, is to ask one member of each section to get the details of
the respective class. Another way is to get the information directly
from class Attendance Register or school website.
(b) Planning
All events should start with a plan and there is a need for regular
discussions among participants. Initially a group meeting is to be
organised to discuss the objective, requirement and proposed line of
action. Conventional way of holding a meeting is to inform students on
the notice board or through class announcement. Another way of
informing all the participants is by sending e-mails. An agenda of the
farewell party is to be prepared and communicated to all members
mentioning time, date and venue.
(c) Identification of Task
In the main event there are various subtasks which are to be delegated
to different groups. Broadly the following tasks has to be assigned.
Coordination of management for date, venue, chief guest and special
invitees.
Budget estimate.
Collection of funds.
Procurement of food and cold drinks.
Procurement of gifts and mementoes.
Organisation of cultural program.
Maintenance of accounts.
Coordination and monitoring.
Guidelines
Use communication tools such as Messenger from any service provider
such as Yahoo or own school e-mail service for creating task based
groups. Members of each group should exchange information and get
consolidated view. The decision can be then forwarded to coordination
and monitoring group. The status of each task should be updated to
the notice board or website or by sending the status report to all
members through e-mails. This will create interest and enthusiasm in
all the members whether he/she is involved directly or indirectly. A
website can also be created where each member can post the status
and notices regarding events.
(a) Delegation of Task
Once the subtasks are identified, the jobs have to be delegated to
various groups. During allocation of tasks, it should be kept in the
mind that representatives of all the classes are properly selected.
(b) Estimation
can be gathered from internet or by telephone. This will give fair idea
about the expense and contribution from each student. The same can
be informed to all the members with details of where and to whom the
contribution is to be submitted.
(c) Collection of Funds
All the members can deposit their contribution to the designated
member of their respective classes. The same can be updated in the
database, and if required the same can be updated in the website also.
A system can be developed to track the collection and expense.
(d) Allocation of Funds
As per the estimation each group would be allocated the funds. The
group would regularly update the expenses, by keeping, bill/receipt of
expenses made.
(e) Cultural Program
There would be maximum participation of members in this group and
would require coordination and regular meetings for making the event
interesting. This task can be coordinated by e-mails. E-mail is a very
effective tool for communication and can be used for communicating
about rehearsal schedules. It will be better to use a unified messaging
service for communication and event management.
Outcome
A good organisation of farewell party to outgoing students of class 12th.
4. Political information
(a) Number and names of the assembly constituents:
(b) Number and names of the parliament constituents:
(c) Names of earlier MPs:
(d) Name of present MP and MLA:
(e) Political parties and their percentage of voting in a district:
(f) Percentage of women participation in the local government body:
Outcome
A brief report on the history, geography and political information of
your home district.
(a) Planning : The purpose of making the website should be very clear
among all team members. Create a detailed document containing
all the information about the website.
(b) Designing : After drafting the document, your next step will be to
design all the web pages using any web editor.
(c) Coding : Now, the team is ready to validate web pages using Java
Scripting language with proper documentation. The coding team
needs to submit their code in time to the team leader. After
11.3.8 ESTABLISHMENT
OF
A COMPUTER NETWORK
Procedure
Look at the figure 11.8 of Computer Network.
First of all manage all the computers in the desired location.
Cut LAN cable according to the distance of the computer and the switch.
Outcome
All the computers of the school are
connected through network and Internet.
Voice Messages
and call History
Check mail
Connect to www
Call
Send
Document
Check mail
Summary
Projectbased learning activities provide opportunities for students to work on problems
in the real world.
Modular approach is one of the approaches to execute a project.
Projects can build students abilities to set personal goals and standards of excellence.
The success of the project depends on the whole team and not on an individual.
Each team member should possess characteristics such as a Coordinator, Shaper, Worker,
Specialist, Accelerator, Finisher, and Critics to become the role model.
Teamwork is based on listening to others, sharing ideas and opinions with team-mates,
giving equal respect to every team member, helping nature, ensuring the participation of
each member in the discussion or working.
Tracking changes is very useful in project work.
Various techniques can be used to solve day to day problems in stages to achieve the
proposed goals.
EXERCISES
SHORT ANSWER TYPE QUESTIONS
1. What is project based learning? What are its characteristics?
2. Comment on Projects can be executed only with teamwork with the help of
examples.
3. What is meant by modular approach to project based learning? Explain its
various subtasks with the help of examples.
4. Explain different components of teamwork with the help of an example.
5. What are the benefits of working through projects?
6. What are the advantages of modular approach?
7. Describe the roles of different team members in a project.
Activities
Write down the steps involved in execution of the following projects.
1. Event management
2. Literacy monitoring of a region
3. Preparation of a website for time table of a school
4. Establishing a wireless network of computers
CCT PROJECTS IN
LOCAL CONTEXT
Objectives
After completing this Chapter, the
student will be able to:
12
Introduction
There are several services provided by the
government to solve our day-to-day problems. With
the growth of CCT the government has taken steps
to use various computer communication tools and
technology to modernise its working. It helps in
providing the services more conveniently and a
means for the public to easily avail these services.
This affects the service provider (Government) and
the recipient (the citizen) both. Most of these
projects are driven by local needs to exploit CCT
for better services, efficiency and transparency.
Various state governments have implemented
projects with reference to the local context.
This chapter will provide exposure to various
initiatives taken by the government in
implementing projects covering various aspects of
our society.
IN
LOCAL CONTEXT
State MMPs
Integrated MMPs
Income Tax
Agriculture
e-BIZ
Land Records
EDI(Electronic Data
Interchange)
India Portal
MCA 21
Treasuries
Common Service
Centres (CSC)
National ID
Commercial Taxes
EG Gateway
Pensions
Gram Panchayats
e-Procurement
e-Office
Municipalities
Banking
Registration
Insurance
Police
e-Courts
Employment
Exchange
e-District
Source : DIT, Ministry of Communication and Information Technology
State/Union Territory
Andhra Pradesh
Assam
Bihar
Chattisgarh
Delhi
Goa
Gujarat
Haryana
Himachal Pradesh
DACNET
Jharkhand
Karnataka
Kerala
Madhya Pradesh
Maharashtra
Orissa
Punjab
Rajasthan
Sikkim
Tamil Nadu
Tripura
Uttarakhand
Uttar Pradesh
West Bengal
North-Eastern States :
Arunachal Pradesh,
Manipur,
Meghalaya, Mizoram
and Nagaland
Andaman and
Nicobar Islands
Dweep Bhumi
Chandigarh
e-Sampark
Suvidha
Suvidha
Lakshadweep
Puducherry
of
Urban
Summary
With the advent of CCT, the Government of India has taken steps to use various technologies
to modernise its functioning.
Various State governments also have implemented e-Governance Projects in reference to
local Contexts.
e-Governance is the application of information and communication technologies to
transform the efficiency, effectiveness, transparency and accountability of informational
and transactional exchanges.
NeGP implements a number of Mission Mode Projects (MMPs) both at the central and
state levels to create a citizen-oriented environment for e-Governance.
TDIL aims at promoting the use of IT tools for providing services in Regional Indian languages.
The goal behind projects in local context is to make various public services and schemes
available to common man in their own understandable language.
EXERCISES
SHORT ANSWER TYPE QUESTIONS
1. Define eGovernance.
2. What is the need for eGovernance?
3. What is mGovernance?
4. Expand the following abbreviations:
CSC
NeGP
SWAN
SDC
MMPs
5. Name some on-going eGovernance projects?
EMERGING
TRENDS IN CCT
Objectives
After completing this Chapter, the
student will be able to:
explain Nanotechnology.
13
Introduction
By now you have come out of the conventional
ideas of a computer whether in regard to its
physical appearance or its functionalities and seen
the multifarious fields of activities in which the
principle is operative irrespective of the physical
appearances of the device. With electronic devices
becoming ubiquitous, it is important to know and
understand the latest trends and anticipate what
is coming in the near future. It is a process of
continuous evolution, constantly updating and
improving in efficiency and functionality.
Not only the computer system has become
faster, compact and inexpensive but associated
communication system has also become
affordable, reliable and user friendly.
The processing speed of the computers is
getting nearly doubled and every year a new
processor is released. Still research is going on to
look for different avenues for improving computer
processing
using
improved
materials,
nanotechnology, multi core processors, quantum
computers, etc.
Hard Disk
We have seen tremendous growth in the hard disk capacities over
years which is expected to grow even further. Hard disk drives have
become faster, with faster seek time, larger cache sizes, and higher
interface speeds. One of the most important parameters for improving
performance is the higher spindle speed, effectively improving the
internal data rate and reducing latency. Nanotechnology has played
an active part in reducing the size of hard disks and in the increase
of their capacities.
Hybrid Hard Disk Drive (HHDD) is a newer technology where the
conventional disk drive is combined with non-volatile flash memory, of
typically 128MB or more to cache data during normal use. The data is
initially stored in non-volatile memory before permanently storing it in
the hard disk. Enterprise HDDs are specifically designed for missioncritical applications such as core servers and large-scale storage systems.
The first hybrid hard disk drives were 2.5 inch drives for notebooks.
Whole Disk Encryption/Full Disk Encryption (FDE) is a new
technology (hardware or software) where data is encrypted before
storage. This prevents unauthorised access or retrieval of data.
Micro Electro Mechanical Systems [MEMS]-based storage is a new
technology being developed as a new age storage media due to its
attractive features such as small size, shock resistance, and low-power
consumption. MEMS-based storage is anticipated to be widely used for
mobile consumer electronics.
Storage
...plus processing
Holographic Memory
Holographic Memory is quite similar to 3-D Optical Data Storage. Here
data is recorded through full depth of the media instead of only on the
surface. Thus it can record and read millions of bytes of data with a
flash of light. High density Optical disc is an example of holographic
storage.
Network Storage
Network storage allows consolidating all data spread over various parts
of the organisation into one location, from where it is accessed by
multiple applications across the network simultaneously. There are
two technologies which are being used - SAN and NAS.
Storage Area Network (SAN)
Peripheral/Interface
Universal Serial Bus (USB) is used for connecting peripherals to PC.
The popularity of USB is due to its low cost, ease-of-use, and small
connector size. It is easy to add USB support to any peripheral. Latest
USB trends are discussed in the following section.
USB in embedded systems
USB has a vast number of applications in embedded systems like cell
phones, PDAs, digital cameras, printers, and set top boxes.
Wireless USB
Wireless USB allows low-speed devices
to connect without wire, but appear to
the host as if they are connected over
wired USB. Wireless USB (Figure 13.7)
is an ideal solution for simple cable
replacement applications.
13.1.2 MICROPROCESSOR
Figure13.6 : USB embedded massage ball
A microprocessor is a multipurpose
programmable logic device that reads
binary instructions from a storage device
called memory, accepts binary data as
input and processes data according to
those instructions and provides results
as output.
The conventional basic function of a
single microprocessor has been changed
to more complex microprocessor
architecture. Instead of single
microprocessor, packages of multiple
microchips and processors are released
which fulfil and meet the performance
requirement for a computing system for
a particular application. These packages
are simply installed into standard
interface on motherboards.
Figure 13.10 :
Black and white
picture
Computer Aided Design (CAD) software are used to create two and
three-dimensional architectural design. Architects and designers usually
make use of it in drafting and designing bridges, buildings, etc. and
have been found to be very useful as instead of redrawing the whole
plan one can modify or redraw with just a few clicks of mouse. Autodesk
Streamline, AutoCAD, DWGcolumn are a few such software. Use of CAD
saves time in making and editing the drawings
enables the designers to lay out and develop work on the screen
provides print out of the designs
reduces the design cycle and over all product development costs
stores the designs for future purposes in digital form thus occupying
practically no space.
Mapping software
They are also called as Geographic Information System (GIS). They make
use of combination of capabilities of programs like database management,
graphics and spreadsheet etc. for displaying data graphically, in tabular
form, map etc. One can see various data and its patterns and relationships
among the data w.r.t. geographical locations. Based on these presentations
certain important political, social, educational decisions and predictions
(e.g. weather, markets, etc.) can be done which can be useful to farmers,
fishermen, professionals, corporates, politicians etc.. Earthquake 3D, ArcGis,
GeoNetwork OpenSource, Key Indicator Data System (KIDS) etc. are some
examples. The map (Figure 13.13) showing Teacher pupil ratio at primary
stage 2002 has been prepared using Geo Media Professional 4.
PupilTeacher Ratio in Upper Primary Schools, 2002
Himachal Pradesh
Pu
b
njaChandigarh
na
rya
Ha
Uttaranchal
Delhi
Sikkim
Rajasthan
Aru
Uttar Pradesh
Assam
Bihar
ha
nac
a
l Pr
des
Nagaland
Meghalaya
Manipur
Gujarat
Jh
Madhya Pradesh
Ch
ha
s
tti
ga
ark
Tripura
d
an
Mizoram
West Bengal
rh
Orissa
Maharashtra
Andhra Pradesh
Goa
Ka
rn
at
a
ak
PupilTeacher Ratio
11 to 20
Pondicherry
Lakshadweep
Kerala
Tamilnadu
Andman Nicobar
21 to 30
31 to 40
41 to 50
51 to 75
13.6 NANOTECHNOLOGY
Nanotechnology is a technology for building or constructing materials,
devices, tools etc. in smallest or lowest possible form i.e. on the scale
of atom and molecule. One nanometre is a one billionth of a meter.
Nanotechnological inventions would bring enormous benefits and
luxury in human life. It is widely believed that nanotechnology has got
the much needed potential to be effective in terms of energy
consumption besides being environment friendly. It is also expected to
solve major health problems. Applications of this technology will help
manufacturing products at reduced cost which will be smaller, lighter
and cheaper.
The Nanotechnology is believed to be very promising in bringing
solutions in the fields of health and sanitation, food security and
environmental issues.
Summary
Improvements in Hard disk drive performance have resulted from faster data rates, faster
seek times, larger cache sizes, higher interface speeds, advances in microcode algorithms
and most importantly higher spindle speed.
Emerging trends in Hard Disk Drives include Enterprise HDDs, Hybrid HDDs, Full Disk
Encryption (FDE) and Micro Electro Mechanical Systems (MEMS).
Enterprise HDDs are specifically designed for mission-critical applications such as core
servers and large-scale storage systems.
A Hybrid Hard Disk Drive combines a conventional HDD and non-volatile flash memory.
Full Disk Encryption (FDE) is a technology where data is encrypted before storage.
MEMS-based storage has attractive features such as small size, shock resistance, and
low-power consumption.
Redundant Array of Inexpensive Disks (RAID) is used to store the same data at different
places redundantly on multiple hard disks.
Network storage like SAN and NAS allows consolidation of data spread over various
parts of the organisation and reduces duplication of information.
Online storage options provide viable storage solutions through normal Internet
connections for small size companies.
Using 3D optical data storage technology, data is stored in multiple layers in the optical disc.
Holographic storage system is an emerging technology where data is stored through full
depth of the media instead of only on the surface.
Universal Serial Bus (USB) has become the technology of choice for connecting
peripherals to PCs, cell phones, printers etc.
Wireless USB allows connectivity to low speed devices at reasonable cost.
EXERCISES
SHORT ANSWER T YPE QUESTIONS
1. Give any two examples of dual core processors.
2. Describe the characteristics of Xeon processors.
3. Differentiate between 3-D optical and holographic memories.
4. What is Nanotechnology?
5. What is component driven software development?
6. How Graphene is expected to improve the computer processing speed?
4. Describe how binary data is stored and represented in 3-D optical storage
devices.
5. What is network storage? Describe various upcoming network storage trends.
6. Mention the roles software play in our daily life. Describe with examples.
7. Describe the advantages of using a mapping software.
8. Compare educational software and computer game software.
9. Categorise different application software according to their use and give
examples for each.
Activities
1. Make a comparative chart of different types of processors.
2. Find out and compare the data transfer speeds of the various data storage devices that
you use like hard disks, CDs, DVDs, flash disks and others.
3. Take any unusable/malfunctioning CD and DVD and study their cross-sectional view.
Observe and compare the functionalities of the different layers contained in them.
4. For each of the emerging data storage device that you have studied find out the status of
its commercial production the company and the device that has been launched or is yet
to be launched.
5. Find out if some organisation or institute that is accessible to you uses a network storage
setup and study it.
REFERENCES
Books
Emerging Web Services Technology by Cesare Pautasso and Christoph Bussler,
Publisher: Birkhause Verlag, P.O. Box 133, CH -4010 Basel, Switzerland
URLs
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
www.wikipedia.org
www.intel.com
www.amd.com
www.cyrix.com
www.research.ibm.com
www.ieeexplore.ieee.org
www.articlesbase.com
www.science.nasa.gov
www.experts-exchange.com
www.ietcom.oxfordjournals.org
www.crnano.org
www.webopedia.com
COMPUTER
CONTROLLED
DEVICES
Objectives
After completing this Chapter, the
student will be able to:
14
Introduction
Technology has touched almost all aspects of our
life. Whether it is banking, telecom, communication,
health, engineering or automated processes
computer controlled devices not only make our lives
convenient but also enable us to take important
decisions.
So far we have been learning about various
usage of computers and its functioning and also
its varied uses in our daily lives. In the present
chapter we will learn more about devices that work
by computer controlled mechanisms. These devices
are termed as computer controlled devices that
have become part of our daily living in many ways;
some of them are simple while on the other hand
some are very complex in their functions.
This chapter would help students to familiarise
with applications of such devices, and sensors that
work in conjunction with computers. First let us
understand, what is the meaning of a computer
controlled device? A computer controlled device is
a device that accepts physical inputs from external
source and pairs this information with computer
controlled instructions to perform specific functions.
14.1 SENSORS
Some popular forms of computer controlled devices that we readily
encounter are sensors of a wide variety. A sensor is defined as a
device that receives signal or stimulus (as heat, pressure, light etc.)
and responds to it in a distinctive manner. These sensors are used at
railway stations in escalators, in weighing machines, and also in robots
that have specific functions.
Interestingly it is to be noted that the way robots function is not the
same as the way sensor operated devices function. However sensors
are also used extensively as embedded component in robots that have
to perform complex functions like surgery or detection of explosive in
public places.
Robots mostly work on a pre-installed instruction program that
has a control through a computer assembly whereas sensors function
on the inputs that they receive in physical form from the external
environment and then they convert this input into electronic signals
and that finally leads to a desired action or response. In the following
part of this chapter we would see the usage of sensors as computer
controlled devices in and around us.
There is an enormous variety of devices in which the computer
functions on the basis of the input provided to it through a wide variety
of devices called sensors. A sensor is a
device that senses and measures physical
attributes like temperature, pressure etc.
and converts it into a signal which is read
by an observer or by an instrument
particularly.
The commonly used barcode is perhaps
the most common example of how a sensor
collects data and makes it computer
readable. Barcodes are familiar black and
white stripes on packaged goods,
containing information on the type of an
item, identity of its manufacturer, its price,
OF
SENSORS
Motion Detection
Motion of an object is detected electronically using infrared light or
laser technology and acoustic devices. Motion detectors have sensors
that detect movement and send a signal to a sound device that produces
a sound alarm. There are motion detectors that employ cameras to
capture images and send them to a computer. Such sensors are used
in banks, shopping malls etc.
Once the position of the object is established, the GPS unit can
calculate other information, like speed at which it is moving, the track
it follows, the places it has been through during the trip, its distance
to destination, and more.
Figure 14.2 : Looking for a site in Delhi using GPS
we keep using frequently in our daily lives, the ATM. From the ATM
teller we get access to a host of services like bank account related
information, cash deposit, cash withdrawal etc. try to understand how
this computer controlled device functions in a slightly greater detail.
An ATM
The following figures 14.4 and 14.5 display an ATM, the block
diagram and a systems overview of an ATM which is computer controlled
and organsation of different units and their workings through a
computer instucted program mechanism.
14.3 ROBOT
A robot is defined as a computerised system with a motorised
construction (usually an arm) capable of interacting with the
environment. In its most basic form, it contains sensors, which provide
feedback data on the robots current situation, and a system to process
this information so that the next action can be determined.
Robots are able to perform repetitive tasks quickly, cost effectively,
and accurately than humans. This includes robotic arms and motors
(also known as actuators). Most advanced robot arms make use of
sensors like motion and pressure sensors in order to detect foreign
obstacles and avoid breaking or dropping what it is carrying.
We see applications of robots to perform a host of tasks ranging
from simple picking up of objects to assembling of parts. For example
in the automobile industry, a customised program is preinstalled in
the robots through a computer that controls the functioning of the robot
in the desired manner. The same robot can perform diversified functions
depending upon the type of programs that are installed into it.
Modern banking would not be possible without these devices and
on the versatile applications of computers. The Automated Teller
Machines (ATM) are a familiar example of everyday application of
computer controlled devices. If you want to withdraw cash from an
ATM, you insert your ATM card in the machine. It verifies your
credentials, takes up the request, processes it, and then dispenses the
cash amount along with a brief statement.
The list of such systems in use today is indeed very long. The
examples chosen here are those of familiar applications of sensors of
various kinds, controlled/coordinated and monitored by computers.
OF
ROBOTS
Figure 14.7 : Electric connection system using robot arm in an industrial setting
Summary
A computer controlled device accepts physical inputs from external source and pairs this
information with computer controlled instructions to perform specific function.
Most of the computer controlled devices make use of sensors.
A sensor is a device that receives signal or stimulus (e.g. voltage, heat, pressure, radiation,
sound waves, humidity etc.) and responds to it in a distinctive manner.
The sensors find its utility at variety of machines/devices like bar code scanners, weighing
machines, escalators, automatic flush, ATM, robots.etc.
The barcode scanner is an optical device, which reads the barcodes by shining light over
these. The barcodes (familiar black and white stripes on packaged goods) contain
information on the identity of item, its manufacturer, its price, etc.
A smart sensor collects data and process the information into result in a unit appropriate
for the particular physical attribute.
A robot is a computer controlled device programmed to move, manipulate objects, and
accomplish work while interacting with its environment.
The robot, in its most basic form, contains sensors, which provide feedback data on the
robots current situation, and a system to process this information according to preprogram instructions so that the next action can be determined accordingly.
The robots perform a host of complex and repetitive jobs precisely, accurately and quickly.
A few of the jobs performed by robots are:
car welding,
surgery,
detecting and picking foreign obstacles without breaking or dropping what it is carrying,
locating explosives and de-circuiting explosive assemblies saving risks to human beings
and
managing electrical connection systems in high risk zones for power distribution etc.
An Automated Teller Machine (ATM) is a computer controlled machine designed for
financial transactions without going to the bank.
The ATM is connected to the bank database through a computer controlled system that
has capability to perform transactions based upon the information that is provided by
the customer through its banking card (debit/ credit card).
EXERCISES
SHORT ANSWER TYPE QUESTIONS
1. How does a sensor work? Describe its usages at various places.
2. What are different sectors where robots find their usage? Discuss your response
with at least three examples.
3. What are some of the limitations of computer controlled devices? By looking at
the examples derive the probable limitations of computer controlled devices.
4. Weather monitoring through GPS is an example of computer controlled device.
Analyse this statement and present your views either for or against the
statement.
5. Explain the functioning of an Automated Teller Machine (ATM) and how it
makes the banking services more convenient to both the service provider and
the customer.
Activities
For class discussion :
1. Form a study group of five to seven students per group. Discuss the usage of computer
controlled devices and prepare a list of important areas where they are used.
2. List out some of the important applications of such devices.
3. What is the difference between a sensor and a computer controlled device?. Discuss in
small groups of five to eight students.
4. You are traveling from Delhi to Kolkata by train. As you reach Allahabad railway station,
halfway between Delhi and Kolkata, your mobile receives a message saying that you are
at Allahabad. How does this happen? Is it GPS that works?
5. Choose one computer controlled device and prepare a presentation explaining the
following :
a) What is the need of such a device?
b) What are its key components and in simple terms how does it function?
c) What are other areas in our environment that can be assisted with computer
controlled devices?