Information Practices Class 12th
Information Practices Class 12th
BY
Contents
Structure Page No’s
************************
1
A complete energized Study material of Informatics Practices for Class XII
Unit 1
Computer Networking & OSS
Objectives:
In this Chapter you will learn about:
o Networking and Its Need
o Internet
o Switching Techniques
o Transmission Media
o Networking Devices
o Network Topologies & Types
o Network Technology
o Network Security Concepts
o Open Source Concepts
Networking:
We often need peripheral devices and data to be shared among various computers.
In fact, in your school's computer lab, you must have seen one printer which is
connected to only one computer, serving to the needs of all the computers in the
lab. How does this happen? This happens because all your lab's computers and
peripherals are forming a network. They are interconnected with each other
enabling you to send and receive data from one computer to another. Hence it can
be said that two computers are interconnected if they are able to exchange
information.
2
A complete energized Study material of Informatics Practices for Class XII
applications like electronic mail and database management for core business
operations, computer networking becomes increasingly more important.
Needs:
1. Resource Sharing
2. Reliability
3. Cost Factor
4. Communication Medium
Resource Sharing means to make all programs, data and peripherals available to
anyone on the network irrespective of the physical location of the resources and the
user.
Reliability means to keep the copy of a file on two or more different machines, so
if one of them is unavailable (due to some hardware crash or any other) them its
other copy can be used.
Cost factor means it greatly reduces the cost since the resources can be shared.
Communication Medium means one can send messages and whatever the
changes at one end are done can be immediately noticed at another.
Application layer
Presentation layer
Session layer
Transport layer
Network layer
DataLink LLC
layer MAC
Physical layer
(OSI model)
4
A complete energized Study material of Informatics Practices for Class XII
DNS Server(Root)
So DNS converts user understandable Domain Name into respective I.P address.
www.facebook.com 255.216.198.32
(Domain name resolution)
5
A complete energized Study material of Informatics Practices for Class XII
Internet:
The Internet is a system of linked networks that are worldwide in scope and
facilitate data communication services such as remote login, file transfer, electronic
mail, the World Wide Web and newsgroups. The internet is made up of many
networks each run by a different companies and are interconnected at peering
points. It is really a network of networks spread across the globe, all of which are
connected to each other. This super network is a glorified WAN in many respects.
It connects many smaller networks together and allows all the computers to
exchange information with each other through a common set of rules for
communication. These rules are called protocols and the internet uses
Transmission Control Protocol/Internet Protocol (TCP/IP). Programs such as web
browsers, File Transfer Protocol (FTP) clients, and email clients are some of the
most common ways through which the users work on the Internet. With the
meteoric rise in demand for connectivity, the Internet has become a
communications highway for millions of users. The Internet was initially restricted
to military and academic institutions, but now it is a full-fledged conduit for any
and all forms of information and commerce. Internet websites now provide
personal, educational, political and economic resources to every corner of the
planet.
SWITCHING TECHNIQUES:
Switching techniques are used for transmitting data across networks.
Different types are :
1. Circuit Switching
2. Message Switching
3. Packet Switching
Circuit Switching
o Circuit switching is the transmission technology that has been used
since the first communication networks in the nineteenth century.
o First the complete physical connection between two computers is
established and then the data are transmitted from the source computer
to the destination.
o When a call is placed the switching equipment within the system seeks
out a physical copper path all the way from the sender to the receiver.
o It is must to setup an end-to-end connection between computers before
any data can be sent.
o The circuit is terminated when the connection is closed.
o In circuit switching, resources remain allocated during the full length
of a communication, after a circuit is established and until the circuit is
terminated and the allocated resources are freed.
6
A complete energized Study material of Informatics Practices for Class XII
Message Switching
o In this the source computer sends data or the message to the switching
circuit which stores the data in its buffer.
o Then using any free link to the switching circuit the data is send to the
switching circuit.
o Entire message is sent to the destination. It reaches through different
intermediate nodes following the “store and forward” approach.
o No dedicated connection is required.
Packet Switching
o Conceived in the 1960's, packet switching is a more recent technology
than circuit switching.
o Packet switching introduces the idea of cutting data i.e. at the source
entire message is broken in smaller pieces called packets which are
transmitted over a network without any resource being allocated.
o Then each packet is transmitted and each packet may follow any rout
available and at destination packets may reach in random order.
o If no data is available at the sender at some point during a
communication, then no packet is transmitted over the network and no
resources are wasted.
o At the destination when all packets are received they are merged to
form the original message.
o In packet switching all the packets of fixed size are stored in main
memory.
TRANSMISSION MEDIA:
A transmission medium (plural media) is one which carries a signal from one
computer to another. It is also known as communication channel. Transmission
medium can be wired or wireless. We also name them as Guided and Unguided
Media respectively. Wired transmission media includes twisted pair cable, Ethernet
cable, coaxial cable and optical fibre whereas wireless transmission media includes
microwave, radio wave, satellite, infrared, Bluetooth, WIFI etc.
7
A complete energized Study material of Informatics Practices for Class XII
Types:
o Unshielded Twisted Pair (UTP)
o Shielded Twisted Pair (STP
STP offers greater protection from interference and crosstalk due to shielding.
But it is heavier and costlier than UTP.
USE:
o In local telephone communication
o For digital data transmission over short distances upto 1 km
Advantages:
o Easy to install and maintain
o Simple
o Inexpensive
o Low weight
o Suitable for small (Local) Networks
Disadvantages:
o Not suitable for long distance due to high attenuation.
o Low bandwidth support.
o Low Speed
2. Coaxial cable:
o Coaxial cable consists of a solid copper wire core surrounded by
plastic cladding shielded in a wire mesh.
o Shield prevents the noise by redirecting it to ground.
Types:
Coaxial cable comes in two sizes which are called thinnet and thicknet.
8
A complete energized Study material of Informatics Practices for Class XII
Advantages:
o Better than twisted wire cable.
o Popular for TV networks.
o Offers higher bandwidth & Speed
Disadvantages:
o Expensive than twisted wires.
o Not compatible with twisted wire cable.
3. Optical Fibres:
o Thin strands of glass or glass like material designed to carry light from
one source to another.
o Source converts (Modulates) the data signal into light using LED
(Light Emitting Diodes) or LASER diodes and send it over the Optical
fiber.
Advantages
o Not affected by any kind of noise.
o High transmission capacity
o Speed of Light
o Suitable for broadband communication
Disadvantages
9
A complete energized Study material of Informatics Practices for Class XII
Bluetooth:
Bluetooth technology is named after herald Bluetooth and has a range of 10 meters
this type of wireless technology is ideal for mobile battery operated devices. This
type of technology depends on two basic things.
1) radio frequency.
2) Bluetooth software
So the Bluetooth is a short range wireless technology used for personal area
network (pan). Bluetooth implementation normally occurs with 4 pin digit.
Infrared.
Infrared technology allows the computing devices to communicate via short range
wireless signals. Infrared communication occurs within short range distance and
10
A complete energized Study material of Informatics Practices for Class XII
has a range of less than 5 meters. Unlike Bluetooth the infrared signals cannot
penetrate walls and has less data rate as compared to Bluetooth technology, the
various disadvantages of infrared technology are as:
Ionosphere propagation:
In this type of propagation the signals are send to ionosphere where they are
reflected back to the earth.
11
A complete energized Study material of Informatics Practices for Class XII
Microwaves:
Microwaves are transmitted from the transmitters placed at very high towers to the
receivers at a long distance.
Microwaves are transmitted in line of sight fashion, and also propagated through
the surfaces.
Advantages:
o Maintenance easy than cables.
o Suitable when cable cannot be used.
Disadvantages:
o Repeaters are required for long distance communication.
o Less Bandwidth available.
Satellite:
Geostationary satellites are placed around 36000 KM away from the earth‟s
surface. In satellite communication transmitting station transmits the signals to the
satellite. (It is called up-linking). After receiving the signals (microwaves) it
amplifies them and transmit back to earth in whole visibility area. Receiving
stations at different places can receive these signals. (It is called down-linking).
12
A complete energized Study material of Informatics Practices for Class XII
Advantage
o Area coverage is too large
Disadvantage
o High investment
NETWORK DEVICES:
For efficient working of any network, many devices are required. Some of the
common network devices are discussed below:
Modem
o A modem is a computer peripheral that allows you to connect and
communicate with other computers via telephone lines.
o Modem means Modulation/ Demodulation.
o Modulation: A modem changes the digital data from your computer into
analog data, a format that can be carried by telephone lines.
o Demodulation: The modem receiving the call then changes the analog signal
back into digital data that the computer can digest.
o The shift of digital data into analog data and back again, allows two
computers to speak with one another.
RJ- 45 Connector:
RJ-45 is short for Registered Jack-45. It is an eight wire connector which is
commonly used to connect computers on the local area networks i.e., LAN.
13
A complete energized Study material of Informatics Practices for Class XII
Repeaters:
A repeater is an electronic device that receives a signal and retransmits it at a
higher level or higher power, or onto the other side of an obstruction, so that the
signal can cover longer distances without degradation. In most twisted pair
Ethernet configurations, repeaters are required for cable runs longer than 100
meters.
Hubs:
A hub contains multiple ports. When a packet arrives at one port, it is copied to all
the ports of the hub. When the packets are copied, the destination address in the
frame does not change to a broadcast address. It does this in a rudimentary way, it
simply copies the data to all of the Nodes connected to the hub.
14
A complete energized Study material of Informatics Practices for Class XII
Bridges:
A network bridge connects multiple network segments at the data link layer (layer
2) of the OSI model. Bridges do not promiscuously copy traffic to all ports, as hubs
do, but learn which MAC addresses are reachable through specific ports. Once the
bridge associates a port and an address, it will send traffic for that address only to
that port. Bridges do send broadcasts to all ports except the one on which the
broadcast was received.
o Bridges learn the association of ports and addresses by examining the source
address of frames that it sees on various ports. Once a frame arrives through
a port, its source address is stored and the bridge assumes that MAC address
is associated with that port. The first time that a previously unknown
destination address is seen, the bridge will forward the frame to all ports
other than the one on which the frame arrived.
o Bridges come in three basic types:
o Local bridges: Directly connect local area networks (LANs)
o Wireless bridges: Can be used to join LANs or connect remote stations to
LANs.
Switches:
Switch is a device that performs switching. Specifically, it forwards and filters OSI
layer 2 datagrams (chunk of data communication) between ports (connected
cables) based on the Mac- Addresses in the packets. This is distinct from a hub in
that it only forwards the datagrams to the ports involved in the communications
rather than all ports connected. Strictly speaking, a switch is not capable of routing
traffic based on IP address (layer 3) which is necessary for communicating
between network segments or within a large or complex LAN. Some switches are
capable of routing based on IP addresses but are still called switches as a marketing
term. A switch normally has numerous ports with the intention that most or all of
the network be connected directly to a switch, or another switch that is in turn
connected to a switch.
15
A complete energized Study material of Informatics Practices for Class XII
Routers:
o Routers are networking devices that forward data packets between networks
using headers and forwarding tables to determine the best path to forward the
packets. Routers work at the network layer of the TCP/IP model or layer 3 of
the OSI model. Routers also provide interconnectivity between like and
unlike media (RFC 1812).
o A router is connected to at least two networks, commonly two LANs or
WANs or a LAN and its ISP's network.
Gateway:
A Gateway is a network device that connects dissimilar networks. It established an
intelligent connection between a local area network and external networks with
completely different structures.
The computers that control traffic within your company's network or at your local
Internet Service Provider (ISP) are gateway nodes. A network gateway can be
implemented completely in software, completely in hardware, or as a combination
of both. In the network for an enterprise, a computer server acting as a gateway
node is often also acting as a proxy server and a firewall server. Here a proxy
server is a node that is not actually a server but just appears to be so and a firewall
is a system designed to prevent unauthorized access to or from a private network.
A gateway is often associated with both a router, which knows where to direct a
given packet of data that arrives at the gateway, and a switch, which furnishes the
actual path in and out of the gateway for a given packet. It expands the
functionality of the router by performing data translation and protocol conversion.
You will sometimes see the term default gateway on network configuration screens
in Microsoft Windows.
In computer networking, a default gateway is the device that passes traffic from the
local subnet to devices on other subnets. The default gateway often connects a
local network to the Internet, although internal
gateways for local networks also exist.
16
A complete energized Study material of Informatics Practices for Class XII
Star Topology:
The type of network topology in which each of the nodes of the network is
connected to a central node with a point-to-point link in a 'hub' and 'spoke' fashion,
the central node being the 'hub' and the nodes that are attached to the central node
being the 'spokes' (e.g., a collection of point-to-point links from the peripheral
nodes that converge at a central node) – all data that is transmitted between nodes
in the network is transmitted to this central node, which is usually some type of
device that then retransmits the data to some or all of the other nodes in the
network, although the central node may also be a simple common connection point
(such as a 'punch- down' block) without any active device to repeat the signals.
17
A complete energized Study material of Informatics Practices for Class XII
Bus Topology:
The type of network topology in which all of the nodes of the network are
connected to a common transmission medium which has exactly two endpoints
(this is the 'bus', which is also commonly referred to as the backbone, or trunk) –
all data that is transmitted between nodes in the network is transmitted over this
common transmission medium and is able to be received by all nodes in the
network virtually simultaneously (disregarding propagation delays).
Ring Topology:
The type of network topology in which each of the nodes of the network is
connected to two other nodes in the network and with the first and last nodes
being connected to each other, forming a ring – all data that is transmitted between
nodes in the network travels from one node to the next node in a circular manner
and the data generally flows in a single direction only.
Computer Networks:
18
A complete energized Study material of Informatics Practices for Class XII
NETWORK TECHNOLOGY:
1. Ethernet
Ethernet is a type of network developed by Xerox in the late 1970.While Internet
is a global network, Ethernet is a local area network (LAN). Ethernet uses a
communication concept called datagrams to get messages across the network. The
Ethernet datagrams take the form of self-contained packets of information. These
packages have fields containing information about the data, their origin, their
destination and the type of data. The data field in each package can contain up to
1500 bytes.
19
A complete energized Study material of Informatics Practices for Class XII
2. Bluetooth:
Bluetooth technology is named after herald Bluetooth and has a range of 10 meters
this type of wireless technology is ideal for mobile battery operated devices. This
type of technology depends on two basic things.
1) radio frequency.
2) Bluetooth software
So the Bluetooth is a short range wireless technology used for personal area
network (pan). Bluetooth implementation normally occurs with 4 pin digit.
Network Security
20
A complete energized Study material of Informatics Practices for Class XII
Network Threats
There are four primary classes of threats to network security as given below.
Unstructured threats:
Unstructured threats consist of mostly inexperienced individuals using easily
available hacking tools such as shell scripts and password crackers.
Structured threats
Structured threats come from hackers who are more highly motivated and
technically competent. These people know system vulnerabilities and can
understand and develop exploit code and scripts.
External threats
External threats can arise from individuals or organizations working outside of a
company. They do not have authorized access to the computer systems or network.
They work their way into a network mainly from the Internet or dialup access
servers.
Internal threats
Internal threats occur when someone has authorized access to the network with
either an account on a server or physical access to the network. According to the
FBI, internal threat accounts for 60 percent to 80 percent of reported incidents.
Virus
They are programs which can destroy or cause damage to data stored on a
computer system and to the computer itself! Virus program must be executed in
order to infect a computer system. Viruses can attach themselves to other programs
in order to ensure that this happens.
Worms
Worms operate differently to viruses. Worms can spread themselves to other
computers without needing to be transferred as part of a host program i.e. they do
not need carriers for infecting other computers. The first time a user may notice the
presence of a worm is when the computer‟s memory UNEXPECTEDLY fills up.
Trojan horse
Trojan horse, also known as Trojan, describes a list of computer threats that appear
to perform good functions, but actually performs malicious functions that allow
unauthorized access to the hosting machine. FOR EXAMPLE – If a program is
designed in such a way, it could open a gateway for hackers to control and attack
the computer of the user, then this said to be a Trojan horse.
21
A complete energized Study material of Informatics Practices for Class XII
Denial Of Service
It is a type of cybercrime in which a server is flooded by thousands of requests
from illegal users thus denying the access of service to authorized users. The main
aim of this crime is to make server busy which in turn is unable to provide the
service to authorized users.
Snooping
It is an unauthorized access to another person‟s data. Snooping can include casual
observance of an email that appears on another‟s computer screen or watching
what someone else is typing. The hackers can also use special software for
snooping the target computer.
Firewalls
Firewalls play a vital role in providing network security and integrity. A fire wall is
a set of programs located on a network server that protects the network from the
users of other network.
Intrusion Detection
An Intrusion Detection System(IDS) is a device or software that monitors network
or system activities for malicious activities policy violations and produces
electronic reports to the management station. IDS can be either network based, host
based or application based, depending on where they are deployed .Irrespective of
their deployment, IDS function in a generic way. Input data from a system is
collected and processed into a manageable format. The data items are classified as
a threat or harmless. If a threat is detected, then a response is produced, usually in
the form of an alert to the system administrator.
22
A complete energized Study material of Informatics Practices for Class XII
GNU
It is a UNIX like operating system developed by free software movement in
1984.The main objective behind GNU is to produce UNIX like operating system
that is free of cost. Anyone can download, modify and redistribute.
Firefox
Mozilla Firefox is a fast, full featured web browser, that allows us to access the
websites more fastly. It has also additional features that make us to use it
efficiently and can freely downloaded from the internet.
Open Office
Is leading open-source software which helps us in word processing, spread sheets,
presentation, database and more. It is available in all languages and works on all
computers. It can be downloaded and used completely free of charge for any office
purpose.
LINUX
Linux is the best known and most used open source operating system. In many
ways Linux is similar to other operating systems like Windows, OS having
graphical interface. But it is different from in many important ways. First, and
perhaps most importantly, Linux is open source software. The code used to create
Linux is free and available to the public to view, edit and for users to contribute to.
*****************************
23
A complete energized Study material of Informatics Practices for Class XII
Unit 2
Visual Basic Programming
Objectives:
In this Chapter you will learn about:
o VB Basics
o Visual Basic Loops
o Visual Basic Functions
o Forms
24
A complete energized Study material of Informatics Practices for Class XII
There are three primary steps involved in building a Visual Basic application:
1. Draw the user interface
2. Assign properties to controls
3. Attach code to controls
25
A complete energized Study material of Informatics Practices for Class XII
toolbar has buttons that provide shortcuts to some of the menu options.
The main window also shows the location of the current form relative to
the upper left corner of the screen (measured in tips) and the width and
length of the current form.
26
A complete energized Study material of Informatics Practices for Class XII
The Project Window displays a list of all forms and modules making up
your application. You can also obtain a view of the Form or Code
windows (window containing the actual Basic coding) from the Project
window.
27
A complete energized Study material of Informatics Practices for Class XII
As mentioned, the user interface is „drawn‟ in the form window. There are two
ways to place controls on a form:
1. Double-click the tool in the toolbox and it is created with a default size on
the form. You can then move it or resize it.
2. Click the tool in the toolbox, then move the mouse pointer to the form
window. The cursor changes to a crosshair. Place the crosshair at the upper
left corner of where you want the control to be, press the left mouse button
and hold it down while dragging the cursor toward the lower right corner.
When you release the mouse button, the control is drawn.
To move a control you have drawn, click the object in the form window
and drag it to the new location. Release the mouse button.
To a control, click the object so that it is select and sizing handles
appear. Use these handles to resize the object.
Variables in VB:
Variables are used by Visual Basic to hold information needed by your
application. Rules used in naming variables:
No more than 40 characters
They may include letters, numbers, and underscore (_)
The first character must be a letter
You cannot use a reserved word (word needed by Visual Basic)
28
A complete energized Study material of Informatics Practices for Class XII
Variable Declaration
There are three ways for a variable to be typed (declared):
1. Default
2. Implicit
3. Explicit
If variables are not implicitly or explicitly typed, they are assigned the variant type
by default. The variant data type is a special type used by Visual Basic that can
contain numeric, string, or date data.
Examples:
StartTime = Now
Explorer.Caption = "Captain Spaulding"
BitCount = ByteCount * 8
Energy = Mass * LIGHTSPEED ^ 2
NetWorth = Assets - Liabilities
The assignment statement stores information.
29
A complete energized Study material of Informatics Practices for Class XII
(Be careful stacking statements, especially with If/End If structures. You may not
get the response you desire.)
If a statement is very long, it may be continued to the next line using the
continuation character, an underscore (_). Example:
Comment statements begin with the keyword Rem or a single quote ('). For
example:
Rem This is a remark
' This is also a remark
x = 2 * y ' another way to write a remark or comment
You, as a programmer, should decide how much to comment your code. Consider
such factors as reuse, your audience, and the legacy of your code.
Operator Operation
^ Exponentiation
*/ Multiplication and division
\ Integer division (truncates)
Mod Modulus
+- Addition and subutraction
30
A complete energized Study material of Informatics Practices for Class XII
Operator Comparison
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
= Equal to
<> Not equal to
The result of a comparison operation is a Boolean value (True or False).
Operator Operation
Not Logical not
And Logical and
Or Logical or
31
A complete energized Study material of Informatics Practices for Class XII
Do Until/Loop Example:
Counter = 1
Do Until Counter > 1000
Debug.Print Counter
Counter = Counter + 1
Loop
33
A complete energized Study material of Informatics Practices for Class XII
This loop repeats Until the Counter variable exceeds 1000. Note a Do Until/Loop
structure will not be entered if the Until condition is already True on the first
encounter.
This loop repeats Until Sum is greater than 50. And, like the previous example , a
Do/Loop Until structure always executes at least once.
Make sure you can always get out of a loop! Infinite loops are never nice. If
you get into one, try Ctrl+Break. That sometimes works - other times the
only way out is rebooting your machine!
The statement Exit Do will get you out of a loop and transfer program
control to the statement following the Loop statement.
Example
For I = 1 to 50 Step 2
A=I*2
Debug.Print A
Next I
34
A complete energized Study material of Informatics Practices for Class XII
In this example, the variable I initializes at 1 and, with each iteration of the
For/Next loop, is incremented by 2 (Step). This looping continues until I becomes
greater than or equal to its final value (50). If Step is not included, the default value
is 1. Negative values of Step are allowed.
You may exit a For/Next loop using an Exit For statement. This will transfer
program control to the statement following the Next statement.
String Function:
String function are used for manipulation of string
Space ():
The function returns the number of spaces you want to have in the string
35
A complete energized Study material of Informatics Practices for Class XII
Example:
Dim S1
S1= Space (20)
Dim S2
S2 = “Hello”& space (15) & “sameer”
Str Function:
The Str( ) Function converts numbers into strings
Example:
Str (123) Returns “123”
Right Function:
The Right( ) function selects the right most position of a string
Example:
Dim S1, S2
S1 = “Applications”
S2 = Right (S1, 6) Returns “ations”
S2 = Right (S1, 8) Returns “ications”
S2 = Right (S1,20) Returns “Application”
Left Function ( ):
The Left() Function selects the leftmost portion of a string
Example:
Left (“Computer”,3) Returns :- Com
Instr function:
36
A complete energized Study material of Informatics Practices for Class XII
The Instr function is used for searching strings within one string (i.e. search string)
to determine whether it contains another strings (i.e search string ).If the second
string is found the starting character location of that string is returned. If the second
string contains no character, the starting position is returned.
Syntax: Instr([start],string1,string2,[compare])
Example:
Dim string1,s1,op;
S1= “a”
String = “Computer And Internet”
P= Instr (1,String1,s1,1)
Print p
Output :- >> 10
Mid() Function:
The Mid Function returns a string containing a specified number of characters from
a string
Example:
Mid (“Computer Application “,1,4)
Returns >>“Comp”
Mid(“Computer Application”,10,4)
Returns >> “Appl”
Len ( ) Function:
The Len Function is Used To Determine the Length of a string
Example:
Len (“Hello”) Returns :- 5
Len (“Computer Application”) Returns :- 21
Syntax:
37
A complete energized Study material of Informatics Practices for Class XII
Ltrim (String)
Ltrim (String)
Trim (String)
Example:
Dim a,b
A= “__ Computer”
B= Trim (a)
Print b
Output: >> Computer
Example:
Ucase (“CoMpUtEr AppLiCatIoN”)
Output>> COMPUTER APPLICATION
And
Lcase(“CoMpUtEr AppLiCatIoN”)
Output>> computer application
Example:
asc(“C”) >> Returns = 67
asc (“City”) >> Returns = 67
Here we get the same output as this asc function considers the only ist letter of a
string
38
A complete energized Study material of Informatics Practices for Class XII
Example:
StrReverse (“Hello”)
Output = olleh
StrReverse (“Hello Kashmir”)
Output = olleH rimhsak
Numeric Function:
The Numeric functions are also called mathematical functions which help us in
various mathematical calculations.
Sgn ( ) Function:
This Function Returns the sing of an integer or number
Example:
Sign (-12) Returns -1
Sign (0) Returns 0
Sign (14) Returns 1
Int ( ) Function :
This Function is used to find the integer value of a given number. If the number is
negative, it returns the first Negative number Equal to or less than the number.
Syntax:
int (number)
Example:
Int (9.8) Returns = 9
Int (-9.8) Returns = -10
Int (9.1) Returns = 9
Val ( ) Function:
The Val function returns the numbers contained in a string as a numeric value of
appropriate type
39
A complete energized Study material of Informatics Practices for Class XII
Example:
Val (“1125 Computers”) Returns = 1125
Val (“Computers 1125”) Returns = 0
Val (“34 and 25”) Returns = 34
Date ( ) Function:
The date ( ) Function returns the date in mm/dd/yyyy format
Syntax: Date ( )
Example:
Dim a
a= date ( )
print a
Output: 02/08/2015
Day ( ) Function:
The day( ) Function returns the day by passing the date as argument
Example:
Dim a,b
a= “02/11/2014”
b= day(a)
print b
Output: 02
Time( ) Function:
The time function returns a current system time.
Syntax: Time ( )
Example:
Dim a
40
A complete energized Study material of Informatics Practices for Class XII
a= Time ( )
print a
Output: 02:11:14 AM
Now( ) Function:
The Now( ) function returns the current system date and time
Syntax: Now ( )
Example:
Dim a
a= Now ( )
print a
Output: 02/11/2014 02:11:14
Month ( ) Function:
The Month ( ) Function returns the month by passing date as argument
Example:
Dim a,b
a= 02/11/2014
b= Month(a)
print b
Output: 11
Minute( ) Function:
The Minute function returns the minute by passing the time as argument
Example:
Dim a
a= Minute (Time )
print a
Output: 33 (i.e. Current Minute of The Current System time)
41
A complete energized Study material of Informatics Practices for Class XII
Message Box()
As a name implies, it is a mechanism to show a small dialog, which pops up over
the existing application for displaying custom message
Example:
Dim a as integer
a=20
If a > 10 then
MsgBox(“Number is greater than 10”)
Else
MsgBox(“Number Is less than 10”)
end if
Output:
Example:
Dim a
a=val (input box (“Enter the no”))
if a >=0 then
print “Positive Number”
else
print “Negative Number”
end if
Output:
42
A complete energized Study material of Informatics Practices for Class XII
FORMS:
Forms are the basic building blocks of a visual basic application. They are the
actual windows where the user interact while running an application. Forms have
their own Properties, Events and methods for controlling their appearances.
Visual basic supports two types of forms:
In MDI application the parent form is known as MDI form. This MDI form is the
container for all the child forms of the application.
After creating an MDI form, two key properties are set these are auto show
children property and scroll bar property and set these properties to true.
43
A complete energized Study material of Informatics Practices for Class XII
The caption of the child form is also merged with the caption of the parent
form.
When an MDI child form is minimized, the icon of the minimized child form
is displayed in the area of the parent form.
One MDI form cannot block other MDI child winds
Once an MDI application is created. With one MDI parent and no of MDI child
forms. The MDI form is usually made the startup form.
To make the MDI parent form to be the startup form, Go to the project menu and
select project properties and choose the name of MDI form as the startup project.
Now when we open the application, the MDI form will appear first.
*********************************
44
A complete energized Study material of Informatics Practices for Class XII
Unit 3
Fundamentals of DBMS
Objectives:
In this Chapter you will learn about:
o Basics
o Data Types
o Data Integrity
o Constraints
o Keys in Database
o SQL
Introduction:
Database is a collection of related information that is organized in such a way that
supports for easy access, modify and maintain data. The contents of a database are
obtained by combining data from all the different sources in an organization.
Generally, the database is managed by some special software packages known
as Database Management Systems (DBMSs). DBMSs are specially designed
applications to create connection between user and program, and to store data in an
organized manner. The purpose of DBMSs software is to allow the user to create,
modify and administration of database. Examples of database management systems
are:
Ms-Access, MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Oracle, SAP,
dBASE, FoxPro, etc.
45
A complete energized Study material of Informatics Practices for Class XII
Relation:
In database, a relation means a 'table', in which data are organized in the form of
rows and columns. Therefore in database, relations are equivalent to tables.
For example
Relation: Student
Domain:
A domain is the original sets of atomic values used to model data. In data base
management and database, a domain refers to all the possible unique values of a
particular column.
For example:
1. The domain of gender column has a set of two possible values i.e, Male or
Female.
2. The domain of marital status has a set of four possible values i.e, Married,
Unmarried, Widows and Divorced.
46
A complete energized Study material of Informatics Practices for Class XII
Database: Collection of logically related data along with its description is termed
as database.
Example:
Relation: Student
47
A complete energized Study material of Informatics Practices for Class XII
KEYS:
Keys are an important part of a relational database and a vital part of the structure
of a table. They help enforce integrity and help identify the relationship between
tables. There are three main types of keys - candidate keys, primary keys, foreign
keys and alternate keys.
Primary Key: Primary key is a key that can uniquely identifies the records/tuples
in a relation. This key can never be duplicated and NULL.
Foreign Key: Foreign Key is a key that is defined as a primary key in some other
relation. This key is used to enforce referential integrity in RDBMS.
Candidate Key: Set of all attributes which can serve as a primary key in a relation.
Alternate Key: All the candidate keys other than the primary keys of a relation are
alternate keys for a relation.
Data Types:
Data type is an attribute that specifies type of data of any object. Each column,
variable and expression has related data type in SQL. We would use these data
types while creating our tables. We would choose a particular data type for a table
column based on our requirement.
48
A complete energized Study material of Informatics Practices for Class XII
6,7 FLOAT, DOUBLE Four and eight bit numbers with floating
point. Size is fixed, but you can pick how
precise you want them to be.
8,9 TEXT, BINARY These are regular fields with a varying
size. You can store unlimited size (limited
by disk space) text or binary information .
10 IMAGE This is a BINARY field clone. Contains
GIF or JPEG image.
11 FILE This field is similar to TEXT, but contains
the name of the file in a file system.
Essentially this is a pointer to a file.
Data integrity:
Data integrity refers to maintaining and assuring the accuracy and consistency of
data over its entire life-cycle. Data integrity is the opposite of data corruption,
which is a form of data loss.
Types of integrity:
Entity integrity:
It concerns the concept of a primary key. Entity integrity is an integrity rule which
states that every table must have a primary key and that the column or columns
chosen to be the primary key should be unique and not null.
Referential integrity:
It concerns the concept of a foreign key. A foreign key is generally a primary key
from one table that appears as a field in another where the first table has a
relationship to the second. In other words, if we had a table A with a primary key
X that is linked to a table B where X was a field in B, then X would be a foreign
key in B.
Domain integrity:
It specifies that all columns in a relational database must be declared upon a
defined domain. A domain is a set of values of the same type. Domains are
therefore pools of values from which actual values appearing in the columns of a
table are drawn.
User-defined integrity:
It refers to a set of rules specified by a user, which do not belong to the entity,
domain and referential integrity categories.
49
A complete energized Study material of Informatics Practices for Class XII
Front End: User interface by using which the user enters data.
Back end: The layer where actually your tables are created and the data inserted is
stored.
The front-end is everything involved with what the user sees, including design
and some languages like HTML and CSS. The back-end, or the “server-side”, is
basically how the site works, updates and changes. This refers to everything the
user can‟t see in the browser, like databases and servers. Usually people who work
on the back-end are called programmers or developers. Back-end developers are
mostly worried about things like security, structure and content management.
Constraints:
Constraints keep user data constrained, thereby helping to prevent invalid data
from being entered into the database.
NOT NULL:
The constraint NOT NULL prevents NULL values from appearing in a column.
Example:
CREATE TABLE student (col1 INTEGER NOT NULL );
Here in the table student the null values will not be accepted by the table.
50
A complete energized Study material of Informatics Practices for Class XII
UNIQUE:
The UNIQUE constraint prevents duplicate values from appearing in the column.
It is implemented by creating a unique index on a column, as shown below.
CREATE TABLE student (col1 INTEGER UNIQUE);
CREATE TABLE student2 (col1 INTEGER, col2 INTEGER, UNIQUE (col1, col2) );
While col1 or col2 themselves may not be unique, the constraint requires the
combination of col1 and col2 to be unique.
Null:
Null is a special marker used in Structured Query Language (SQL) to indicate that
a data value does not exist in the database. A good way to remember what null
means is to remember that in terms of information, "lack of a value" is not the
same thing as "a value of zero" For example, consider the question "How many
books does Sajad own?" The answer may be "zero" (we know that he owns none)
or "null" (we do not know how many he owns, or doesn't own). In a database table,
the column reporting this answer would start out with a value of null, and it would
not be updated with "zero" until we have ascertained that Sajad owns no books.
Example:
Super Key:
A Super key is any combination of fields within a table that uniquely identifies
each record within that table.
51
A complete energized Study material of Informatics Practices for Class XII
Candidate Key:
A candidate is a subset of a super key. A candidate key is a single field or the least
combination of fields that uniquely identifies each record in the table. The least
combination of fields distinguishes a candidate key from a super key. Every table
must have at least one candidate key but at the same time can have several.
As an example we might have a student_id that uniquely identifies the students in a
student table. This would be a candidate key. But in the same table we might have
the student‟s first name and last name that also, when combined, uniquely identify
the student in a student table. These would both be candidate keys.
Once your candidate keys have been identified you can now select one to be your
primary key.
Primary Key:
A primary key is a candidate key that is most appropriate to be the main reference
key for the table. As with any candidate key the primary key must contain unique
values, must never be null and uniquely identify each record in the table.
Primary keys are mandatory for every table each record must have a value for its
primary key. When choosing a primary key from the pool of candidate keys always
choose a single simple key over a composite key.
52
A complete energized Study material of Informatics Practices for Class XII
Foreign Key:
A foreign key is generally a primary key from one table that appears as a field in
another where the first table has a relationship to the second. In other words, if we
had a table A with a primary key X that is linked to a table B where X was a field
in B, then X would be a foreign key in B.
An example might be a student table that contains the course_id the student is
attending. Another table lists the courses on offer with course_id being the primary
key. The 2 tables are linked through course_id and as such course_id would be a
foreign key in the student table.
53
A complete energized Study material of Informatics Practices for Class XII
For example in the table showing candidate keys above we identified two
candidate keys, student Id and first Name + last Name. The student Id would be
the most appropriate for a primary key leaving the other candidate key as
secondary or alternative key.
Operators in SQL:
The following are the commonly used operators in SQL
1. Arithmetic Operators +, -, *, /
2. Relational Operators =, <, >, <=, >=, <>
3. Logical Operators OR, AND, NOT
54
A complete energized Study material of Informatics Practices for Class XII
e.g: Create table, create view, create index, alter table etc.
Example:
CREATE
Creates new databases, tables and views from RDBMS
Syntax:
Create database tutorialspoint;
Create table article;
Create view for_students;
ALTER
Modifies database schema.
Syntax:
Alter table article add subject varchar;
This command adds new column in the Table article with the name subject of
varchar type.
DROP
Drops commands, views, tables, and databases from RDBMS.
Syntax:
Drop object_type object_name;
Drop database shahi;
Drop table article;
Drop view student;
SELECT/FROM/WHERE:
For example
Select authorname
From book_author
Where age > 50;
This command will yield the names of authors from the relation book_author
whose age is greater than 50.
55
A complete energized Study material of Informatics Practices for Class XII
INSERT INTO/VALUES:
This command is used for inserting values into the rows of a table relation.
Syntax:
INSERT INTO table (colum n1 [, colum n2, colum n3 ... ]) VALUES
(value1 [, value2, value3... ])
Or
INSERT INTO table VALUES (value1, [value2, ... ])
For example:
This command will add new row in a table book with Sajad and information
practice as data items.
UPDATE/SET/WHERE:
This command is used for updating or modifying the values of columns in a table
relation.
Syntax:
This command will replace author anonymous with Sajad in table book
DELETE/FROM/WHERE:
This command is used for removing one or more rows from a table relation.
Syntax:
DELETE FROM table_name [WHERE condition];
For example:
DELETE FROM book WHERE Author="unknown”
This command will delete all those rows where author field contains unknown as
data item.
56
A complete energized Study material of Informatics Practices for Class XII
3. View Definition:
DDL contains set of command to create a view of a relation.
e.g : create view
COMMIT command:
Commit command is used to permanently save any transaction into database.
Syntax:
commit;
Rollback command:
This command restores the database to last committed state. It is also use with
savepoint command to jump to a savepoint in a transaction.
Syntax:
rollback to savepoint-name;
Savepoint command:
Savepoint command is used to temporarily save a transaction so that you can
rollback to that point whenever necessary.
Syntax:
savepoint savepoint-name;
SQL Functions:
SQL provides large number of functions which can be categorized into two types
of functions.
o Single Row Function
o Multiple Row Function (Group Functions)
57
A complete energized Study material of Informatics Practices for Class XII
LOWER:
It takes any string or Column and converts it to lower case
LOWER(String/Column name)
UPPER:
It Works Opposite to Lower function
INIT CAP:
It Converts the First letter of each word to upper case and remaining letter to
lower case.
CON CAT:
It concatenates the two given strings
Example:
Output:
JUNAID NAZIR
Junaid Nazir
Junaid Nazir JayEnn
58
A complete energized Study material of Informatics Practices for Class XII
Length:
It Returns the length of a string
LENGTH (String);
Example:
Length('text');
Output: 4
TRIM
This Function returns the trim heading and trailing characters or both from a
character string.There are two types of TRIM
RTRIM:
Example:
RTRIM(„ABCXY‟,„XY‟);
Output: ABC
LTRIM:
Example:
LTRIM(„xyzABC‟,„xy‟);
Output: zABC
Instr:
Returns the position of the first occurrence of substring substr in string str.
Syntax:
INSTR(str,substr)
Example:
INSTR('foobarbar', 'bar');
Output: 4
LPad
Syntax:
LPAD(str, len, padstr)
Returns the string str, left-padded with the string padstr to a length of len
characters. If str is longer than len, the return value is shortened to len characters.
Example:
LPAD('hi',4,'??');
Output: '??hi'
59
A complete energized Study material of Informatics Practices for Class XII
LPAD('hi',6,'??');
Output: '????hi'
LPAD('hi',1,'??');
Output: 'h'
Substr:
SUBSTR () is a synonym for SUBSTRING ().
Syntax:
SUBSTRING (str,pos)
o Number Function:
CEIL Function:
This Function Returns the smallest integer (or Whole Number) That is
greater than or equal to a specific value.
Syntax:
CEIL(value, Precession)
Example:
Select CEIL (123),CEIL(-456);
CEIL (234.567) From Dual;
When we execute the above statement
CEIL(164.2) -> 164
CEIL(-456 ) -> -456
CEIL(234.567) -> 234
MOD:
60
A complete energized Study material of Informatics Practices for Class XII
Power:
This Function has the ability to raise a value to a given positive exponent
Syntax:
Power (value, exponent)
Example:
Power (10,3)returns 1000
Power (5,5) returns 625
Round:
This function rounds off a number to a given number of digits of precision if
the value is –ve, Round() Returns a whole number containing precession
point
Example:
Round (value, precision)
Round (12345.678) 123456.7
Round (-3456.65, -2) -3500
SQRT:
Finds the square root of a number
Syntax:
SQRT (Value)
Example:
SQRT (100) 10
SQRT (121) 11
o Date Functions:
These Functions allow us to generate and manipulate date data. We can use
data functions to determine the number of months between two dates etc.
MONTH_BETWEEN:
This Function returns the number of months between two dates date1 and
date2. This can be +v or negative if the date1 is larger then date2. The result
is +ve Otherwise result is negative
61
A complete energized Study material of Informatics Practices for Class XII
Syntax:
MONTH_BETWEEN(date1,date2)
ADD_MONTHS:
It returns the date by adding n number of calendar months to a given date.
Syntax:
ADD_MONTHS(date1,n)
NEXT_DAY:
This function finds the date of the next specified day of the weak(„char‟) i.e-
Sunday,Monday…….Saturday after the given date.
Syntax:
NEXT_DAY(date1,„char‟)
This function finds the date of the next special day of the weak.
NEXT_DAY(„26April-2012‟, „Monday‟)
LAST_DAY:
This Function returns the date of the last date of the month. i.e. It contains
the date of the last day of the month
Syntax:
LAST_DAY(MONTH)
o Conversion Function:
These Functions are used to convert data from one type to another
The data type conversion can be implicit or explicit
62
A complete energized Study material of Informatics Practices for Class XII
For Example X will return the hexadecimal value of the specified number of
digits.
TO_NUMBER( )
The TO_NUMBER function converts a character value to a numeric
datatype. If the string being converted contains nonnumeric characters, the
function returns an error.
Syntax:
TO_NUMBER (string1, [format], [nls_parameter])
For Example YYYY will represent Year with 4 numbers
TO_DATE( )
The function takes character values as input and returns formatted date
equivalent of the same. The TO_DATE function allows users to enter a date
in any format, and then it converts the entry into the default format used by
Oracle 11g.
Syntax:
TO_DATE( string1, [ format_mask ], [ nls_language ] )
COUNT
63
A complete energized Study material of Informatics Practices for Class XII
The COUNT function returns the rows count in the table. When used with
WHERE clause, only number of rows which satisfy the condition will be returned.
Returns the number of non-null column values or whole
Rows.
SELECT COUNT(*) "Number of Countries"
FROM wf_countries
MAX
The MAX function returns the maximum value in the specified column. The MAX
function can also be used as the part of sub-query. It is Used with columns that
store any data type to return the maximum value, ignoring null values.
SELECT MAX(highest_elevation) "All time high"
FROM wf_countries;
MIN
The MIN function returns the minimum value in the specified column. The MIN
function can also be used as the part of sub-query. It is Used with columns that
store any data type to return the minimum value, ignoring null values.
SELECT MIN(lowest_elevation) "All time low"
FROM wf_countries;
SUM
The SUM function adds up the values in a specified column. The column must be
of one of numeric data types. The DISTINCT can be used to get the sum of only
unique values. It is used with columns that store numeric data to find the total or
sum of values, ignoring null values
AVG
64
A complete energized Study material of Informatics Practices for Class XII
The AVG function returns the average of all the values in the specified column. As
with SUM function, the column must be of one of numeric data types. The
DISTINCT function can be used to get the average of only unique values. It is used
with columns that store numeric data to compute the average, ignoring null values
SELECT AVG (population) AVERAGE
FROM wf_countries;
***********************************
65
A complete energized Study material of Informatics Practices for Class XII
Unit 4
Internet and Web Application Development
Objectives:
In this Chapter you will learn about:
o Internet Basics
o HTML
o Web Browser
Communication:
Communication means to convey. In today's fast changing world, data needs to be
transferred efficiently, frequently and speedily. To move data at a fast speed and
that too with minimum data loss, networking plays an important role. Computer
networks have made a major impact on the society as a whole. As we are moving
ahead in the 21st century, the world seems to be converging. The merging of
computers and communication technology has changed the very perspective of
communication today. It has had a profound influence on the way the computer
systems are organized and used today. The old model of a single computer serving
all of the organization's computational needs has been replaced by one in which
large number of separate but interconnected computers do the same job. These
systems together form a computer network.
Internet:
The Internet is a system of linked networks that are worldwide in scope and
facilitate data communication services such as remote login, file transfer, electronic
mail, the World Wide Web and newsgroups. The internet is made up of many
networks each run by a different companies and are interconnected at peering
points. It is really a network of networks spread across the globe, all of which are
connected to each other. This super network is a glorified WAN in many respects.
It connects many smaller networks together and allows all the computers to
exchange information with each other through a common set of rules for
communication. These rules are called protocols and the internet uses
Transmission Control Protocol/Internet Protocol (TCP/IP). Programs such as web
browsers, File Transfer Protocol (FTP) clients, and email clients are some of the
most common ways through which the users work on the Internet. With the
meteoric rise in demand for connectivity, the Internet has become a
communications highway for millions of users. The Internet was initially restricted
to military and academic institutions, but now it is a full-fledged conduit for any
and all forms of information and commerce. Internet websites now provide
66
A complete energized Study material of Informatics Practices for Class XII
Though broadband :
67
A complete energized Study material of Informatics Practices for Class XII
These days even wireless connections are available. For this you need to
have a Wi Fi card attached to your computer which can be useful if you do
not have proper place to lay down the wires.
Web Browser:
A web browser is software that allows us to view Web Pages. The most common
web browser is Microsoft Internet Explorer fallowed by Google chrome, Firefox,
opera etc. The Web browser communicates with the web servers via http protocol.
Example:
www.computeworld.com is a URL of computer world server
and
255.128.196.28 represent its (I.P address)
Protocols:
The protocols represent the set of rules and regulations which help in successful
communication between any two computers in a computer network. A protocol is
the “Language” of the network.
68
A complete energized Study material of Informatics Practices for Class XII
There are large numbers of protocols working in the network each with definite
function.
Example:
http (hyper text transfer protocol) This helps in sending requests from client
to server
FTP (file transfer protocol) This helps us in sending files across computer
network
SMTP (Simple mail transfer protocol) This provides the email service to the
user etc
69
A complete energized Study material of Informatics Practices for Class XII
A web search engine is a software system that is designed to search for information
on the World Wide Web. A search engine maintains the following processes in
searching information on WWW.
Web crawling
Indexing
Searching
The various types of search engines are Google, yahoo, bing etc
Web Application:
A Web application (Web app) is an application program that is stored on a remote
server and delivered over the Internet through a browser interface. Web
applications are popular due to the easy availability of web browsers, and the
convenience of using a web browser. Common web applications include webmail,
online retail sales, online auctions, wikis, instant messaging services and many
other functions.
HTML:
HTML Stands for Hypertext markup language Used to design web pages. As its
name suggests, HTML is a Markup Language which means you use HTML to
simply "mark-up" a text document with tags that tell a Web browser how to
structure it to display.
The basic elements necessary to design web pages HTML are as:
Window based computer system with any text editor like Notepad, WordPad
etc.
Browser (internet explorer, opera etc)
There are two types of web pages designed with the help of HTML
70
A complete energized Study material of Informatics Practices for Class XII
<HTML>
<HEAD>
<TITLE>................................................</TITLE>
</HEAD>
<BODY>
~~~~~~~
~~~~~~~
~~~~~~~
</BODY>
</HTML>
Tags can be written in any case (Lower or Upper case) i.e. HTML is not case
sensitive.
Step3: Click file >> Save >> Give file name with “.HTML” or “.htm” extension
(e.g sadaan.html)
Step4: Once the file is saved the file will be executed by the respective Default
internet Browser.
HTML Tags:
There are two types of HTML tags: Container tags and Empty tags
Container Tags:
Container tags are those tags which are used in pairs E.g.:-
<HTML> </HTML>
<Font> </FONT>
<BODY> </BODY>
Empty Tags:
Empty tag is a solo or single tag. It does not have any closing tag e.g:-
<br> => break tag
<Hr> => Header Tag etc
Heading Tags:
To display the text is some special size, heading tags are used. HTML provides six
different heading tags i.e.:- H1 to H6
<H1> Computer </H1>
<H2> </h2>
↓↓ ↓↓
<H6> </H6>
H1 is the highest size and H6 is the lowest size
Body Tags:
All other tags and text we want to show on web page are present within the
<BODY> tags
<BODY>
------
------
</BODY>
72
A complete energized Study material of Informatics Practices for Class XII
Background color :
<body bgcolor=”pink”>
This will change the color of webpage to pink.
Background:
<bodybackgroung =”maria.jpg”>
This will put image (*Maria) as background of the webpage
Paragraph tag:
Paragraph tag is a container tag and is denoted by <P>----</p> this tag inserts a
line break in the web page with extra spacing paragraph alignment by default is left
but we align to the center or right as well.
Example:
<p align=”center”> computers </p>
Horizontal rulers:
Horizontal rulers can be shown in web pages to identify some portion of text in a
particular way. It is denoted by <Hr> it is an empty tag.
Example:
<HTML><BODY><HR></BODY></HTML>
The various attributes of <Hr> tag are: Size, Width and No Shade
Font Tag:
Text can be shown in different styles and attractive looks with the help of <Font>
tag. It is a container tag with both opening and closing tags
Ie: <Font> _ _ _ _ _ _ _ _ _ _ _ _ _ </Font>
Attributes of Font tag:
Size:- It defines the size of the text.
73
A complete energized Study material of Informatics Practices for Class XII
Bold Tag:
To represent the text in bold format we use bold tag i.e.<B>
Example:
<b> computer </b>
This will display Computer in bold format in The web Page.
Italic tag:
we use the <i> tag to represent the text in italic format
Example:
<i> computer </i>
Underline Tag:
<u> tag is used to define the text in underline format.
Example:
<u> Computers </u>
<BODY>
HELLO,I am learning HTML.<br/>
Computer is an electronic device <br/>
</BODY>
</HTML>
Paragraph Tag:
To represent start a new paragraph we use <p> tag. It is a container tag
i.e.<p>.......</p> both opening and closing tags are to be used.
TEXT LINKS:
A webpage can contain various links that take you directly to other pages and even
specific parts of a given page. These links are known as hyperlinks.
Hyperlinks allow visitors to navigate between Web sites by clicking on words,
phrases, and images. Thus you can create hyperlinks using text or images available
on a webpage.
Linking Documents:
A link is specified using HTML tag <a>. This tag is called anchor tag and anything
between the opening <a> tag and the closing </a> tag becomes part of the link and
75
A complete energized Study material of Informatics Practices for Class XII
a user can click that part to reach to the linked document. Following is the simple
syntax to use <a> tag.
<a href="Document URL" ... attributes-list>Link Text </a>
Example:
<html>
<head>
<title>Hyperlink Example</title>
</head>
<body>
<p>Click following link</p>
<a href="http://www.greaterkashmir.com" >Greater Kashmir </a>
</body>
</html>
This will produce the following result, where you can click on the link generated to
reach to the home page of Greater Kashmir (in this example).
Download Links:
We can create text link to make your PDF, or DOC or ZIP files downloadable.
This is very simple; we just need to give complete URL of the downloadable file as
follows:
<html>
<head>
<title>Hyperlink Example</title>
</head>
<a href="http://www.jkbose.nic.in/syllabus.pdf">Download PDF File</a>
</body>
</html>
This will produce a link (Download PDF File) and will be used to download a file.
76
A complete energized Study material of Informatics Practices for Class XII
Table Tag:
We use table tag to define the structure of a table. We use <tr> and <td> tags to
represent the table row and table data respectively as shown above. Besides this we
use <TH> tag to define a header cell in table.
Examples:
<html><BODY>
<TABLE border =1 bgcolor= “green” width =40% Height = 40%>
<tr>
<td>
Computer
</td>
<td>
Hardware
</td> OUTPUT:
</tr>
<tr>
<td>
Software
</td>
<td>
Memory
</td>
</tr>
</table>
</BODY></html>
77
A complete energized Study material of Informatics Practices for Class XII
Lists:
Lists play an important role in defining the various types of lists in the web page
There are various types of lists
1. Ordered Lists(Numbered lists)
2. Unordered Lists(Bulleted lists)
Unordered List
Output(On Web Page)
<BODY>
OUTPUT DEVICES OUTPUT DEVICES
<UL> . Monitor
<LI>Monitor . Printer
<LI>Printer . Speaker
<LI>Speaker
</UL>
</BODY>
Image Tag:
Images are very important to beautify as well as to depict many complex concepts
in simple way on your web page. We can insert any image in your web page by
using <img> tag as shown below.
78
A complete energized Study material of Informatics Practices for Class XII
The <img> tag is an empty tag, which means that, it can contain only list of
attributes and it has no closing tag.
Example:
<html>
<head>
<title>Using Image in Webpage</title>
</head>
<body>
<img src="sajad.jpg" alt ="Test Image" />
</body>
</html>
Note:
We can use PNG, JPEG or GIF image file based on our comfort but make sure we
specify correct image file name in src attribute. Image name is always case
sensitive.
Alternate Text:
The alt attribute is a mandatory attribute which specifies an alternate text for an
image, if the image cannot be displayed as shown below.
79
A complete energized Study material of Informatics Practices for Class XII
This will set the width and height of image to 150 and 100 respectively.
HTML Backgrounds:
The <body> tag has two attributes where you can specify backgrounds. The
background can be a color or an image.
80
A complete energized Study material of Informatics Practices for Class XII
Will the background image increase the loading time too much?
Will the background image look good with other images on the page?
Will the background image look good with the text colors on the page?
Will the background image look good when it is repeated on the page?
Will the background image take away the focus from the text?
Web Browser:
A web browser is software that allows us to view Web Pages. The most common
web browser is Microsoft Internet Explorer fallowed by Google chrome, Firefox,
opera etc. The Web browser communicates with the web servers via http protocol.
81
A complete energized Study material of Informatics Practices for Class XII
Web Address:
Each website in the internet possesses at least one internet protocol (IP) address
also known as web address.
The IP address is 32 bit (Ipv4) or 128 bit and is given in user-friendly format this
we call URL (Uniformly Resource Locator)
Example:
www.computeworld.com is a URL of computer world server and
255.128.196.28 (I.P address)
Web Server:
A web server is a special software capable of servicing http requests from the
client, so when we open a web site in our browser(called the client software) a
request is sent to the web server on the remote machine. The web server listens to
requests, process them and send responses back to client
The client is usually a browser such as Internet Explorer interact with the server
using a set of instructions called protocols these protocols help in successful
communication between client and server
***************************
82
A complete energized Study material of Informatics Practices for Class XII
Book References
1. E Balagurusamy
QR Code References
1. E- Content developed by Sajad Akbar Rather (I/C ICT DIET SOPORE)
3. www. easytuts4you.com
4. SuccessCDs (http://youtu.be/Kelm63Q-LO8)
6. http://youtu.be/SJXTjSqjcLg
***************************************
83