0% found this document useful (0 votes)
24 views

Html&java Script Programs

The document contains HTML code for various web pages and programs including a solar water heater page, a page displaying names of continents, nested and bio-data lists, an application form, and a framed page with states of India. Key elements include headings, paragraphs, unordered and ordered lists, tables, forms, frames, links and colors.

Uploaded by

sreeroyal986
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Html&java Script Programs

The document contains HTML code for various web pages and programs including a solar water heater page, a page displaying names of continents, nested and bio-data lists, an application form, and a framed page with states of India. Key elements include headings, paragraphs, unordered and ordered lists, tables, forms, frames, links and colors.

Uploaded by

sreeroyal986
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 19

HTML, JSP Programs

1. Design a document specifying the usage of solar water heater.

<html>
<head>
<h1 align="center">
<blink>
<font color="green"> SOLAR WATER HEATER
</font>
</blink>
</h1>
<title>SOLAR WATER HEATER</title></head>
<body bgcolor="gold">
<p><font color="red">Who can use solar water heater</p> </font>
<font solar="choclate">Any body with a regular heat water demand
</font>
<ul><font color="blue">
<li>In houses for domestic purpose(cooking,bothing,washing)
<li>For enginerring/chemical industrials/duries/texttiles/water
processing plants
<li>For hotels,hospitals,guest houses and industrial canteens
<li>For food processiong plants and processing applictaions </font>
</ul>
<p><u> <font color="voilet">special features of the water heater is </font>
</u>
<font color="purple"><ol type=A>
<li>100% descrption allowed for tags payers
<li>capital investement paid back with 3-4 years with commutative energy
savings
<li>Long life of the system rules((15-20)years) enarmos life time energy
savings
<li> Non polluting energy source </font> </ol>
</body>
</html>

1
Output:
SOLAR WATER HEATER
Who can use solar water heater
Any body with a regular heat water demand
In houses for domestic purpose(cooking,bothing,washing)
for enginerring/chemical industrials/duries/texttiles/water processing plants
for hotels,hospitals,guest houses and industrial canteens
For food processiong plants and processing applictaions
special features of the water heater is
100% descrption allowed for tags payers
capital investement paid back with 3-4 years with commutative energy savings
Long life of the system rules((15-20)years) enarmos life time energy savings
Non polluting energy source

2. write a html program for displaying the names of several


contents in the world.
World.html
<html>
<head>world
<title> world </title>
</head>
<body bgcolor="green"> <br>
<a href="Europe.html"> Europe </a> <br>
<a href="America.html"> America </a> <br>
<a href="Asia.html"> Asia </a><br>
<a href="Australia.html"> Australia </a> <br>
<a href="Africa.html"> Africa </a> <br>
</body> </html>

Europe.html
<html> <head>
<h1 align="center"><font color="red">EUROPE</h1>
</center></font>
<title>EUROPE</title></head>
<body bgcolor="tan">
<p><font color="blue">EUROPE is second smallest country in the WORLD
<br>Europe civilization is the logically derived from the greeks
<br>some of the important countries in the EUROPEAN contient is</p>
</font>
<ul type="circle">
<font color="gold"><li>FRANCE
<li>ITALY
<li>PARIS</font></ul>
2
</body> </head> </html>

America.html
<html>
<head>
<h1 align="center"><font color="RED">AMERICA</h1>
</center></font>
<title>AMERICA</title></head>
<body bgcolor="indigo">
<p><font color="blue">AMERICA is richest country in the WORLD
<br>some of the important countries in the AMERICAN contient is</p>
</font>
<ul type="bulletses">
<font color="pink"><li>CANADA
<li>MEXICO
<li>CHICAGO
<li>NEWYORK</font></ul>
</body> </html>

Asia.html
<html>
<head>
<h1 align="center"><font color="gold">ASIA</h1>
</title>
</head>
<body bgcolor="red">
<p><font color="blue">ASIA is biggest countries in the WORLD
<br>some of the important countries in the ASIA contient is</p>
</font>
<ul type="bullet">
<font color=”green"><li>INDIA
<li>PAKISTAN
<li>SRILANKA
<li>BANGLADESH</font></ul>
</body> </head>
<html>

3
Australia.html
<html>
<head>
<h1 align="center"><font color="choclate">AUSTRALIA</h1></font>
<title>AUSTRALIA</title></head>
<body bgcolor="gold">
<p><font color="blue">AUSTRALIA is smallest country in the WORLD
<br>it is Island contient and largest all Islands
<br>some of the important countries in the AUSTRALIAN contient is</p>
</font>
<ul type="bullets">
<li><font color="red">SYDNEY
<li>MELLBOWRNE
<li>PERTH
<li>HOBOART</font></ul>
</body>
</head>
<html>

Africa.html

<html>
<head>
<h1 align="center"> <font color="teal">Africa</h1>
</font>
<title> AFRICA
</title> </head>
<body bgcolor="red">
<p> <font color="blue"> Africa is developing
country with natural resources <br> some of the important countries in the
Africa continent
is
</font>
<ul type="square">
<font color="orange"><li> Egypt
<li> SUDA
<li> ZIMBAMBWE
<li> SOUTH AFRICA </FONT> </UL>
</body>
</html>

4
Output:-
world
europe
America
Asia
Australia
Africa

EUROPE
EUROPE is second smallest country in the WORLD
Europe civilization is the logically derived from the greeks
some of the important countries in the EUROPEAN contient is
FRANCE
ITALY
PARIS

AMERICA
AMERICA is richest country in the WORLD
some of the important countries in the AMERICAN contient is
CANADA
MEXICO
CHICAGO
NEWYORK

ASIA
ASIA is biggest countries in the WORLD
some of the important countries in the ASIA contient is
INDIA
PAKISTAN
SRILANKA
BANGLADESH
AUSTRALIA
AUSTRALIA is smallest country in the WORLD
it is Island contient and largest all Islands
some of the important countries in the AUSTRALIAN contient is
SYDNEY
MELLBOWRNE
PERTH
HOBOART

Africa
Africa is developing country with natural resources
some of the important countries in the Africa continent is
Egypt
SUDA
ZIMBAMBWE
SOUTH AFRICA

5
3. write a html program to create nested list.

<html>
<head>
<title> library</title> </head>
<body>
<ol> <font color="red">
<li> Cinema
<ul>
<li> Bombay
<li> I LOVE YOU
<li> crazy crazy
<li> The Sun
</ul>
<li> Educational
<ul>
<li> Mathematics
<ol type=i>
<li> Part 1: Analystical Geomantry
<li> Part 2: Calcules
<li> Part 3: Trigonametry
</ul>
<li> Cultural
<ul>
<li> Classical music
<ol type=i>
<li> M.S Subbalakshimi
<li> Jesus Day
<li> Thiraraja Bhagavathar
</ol>
<li> Classical Dances
<ol type=i>
<li> Bharatha Ntatyam
<li> kuchipudi
</ol>
</ul>
</body>
</html>

6
Output:-
Cinema
Bombay
I LOVE YOU
crazy crazy
The Sun
Educational
Mathematics
part:1 Analystical Geomantry
Part:2 Calcules
Part:3 Trigonametry
Cultural
Classical music
M.S Subbalakshimi
Jesus Day
Thiraraja Bhagavathar
Classical Dances
Bharatha Ntatyam
kuchipudi
4. write html program to create bio-data form.
<html>
<table border=10 width=75%>
<caption>Bio-Data</caption>
<tr><th align=left colspan=6>
name<td align=left colspan=15>
<tr><th align=left colspan=6> date of birth
<td><th align left colspan=6>
<tr><th align=left colspan=6> religion<td align=left colspan=15>
<tr><th align=left colspan=6> community<td align=left colspan=15>
<tr><th rowspan=4 align=left colspan=5>
address<td> street<td align=left colspan=15>
<tr><td> Town <td align=left colspan=15>
<tr><td> District <td align=left colspan=15>
<tr><th align=left rowspan=2 colspan=5>
phone<td>office<td align=left colspan=15>
<td> residence<td align=left colspan=15>
<tr><th align=left colspan=2> Educational qualification
<tr><th align=5> <th>degree <th>university
<th>Month&Year
<th>Grade/mark
<tr>
</table>
7
</html>

Output:-
Bio-Data
name
date of birth
peligion
community
street
Town
address
District
office residence
Educational phone
qualification
degree university Month&Year Grade/mark

5. write a HTML program to create Application form.

<html>
<head>
<title> application form </title>
</head>
<h3>application form for admission to the undergrate program<br></h3>
<form>
1.Name of the application<input type="text"name="Name"> <br>
2.Address:Street <input type="text" name="Street">
Town<input type="text" align="center" name="Town">
State<input type="text" name="pincode"><br>
3.Course:applied for:
<input type="radio" name="course">Computer science
<input type="radio" name="course">Physics<br>
<input type="radio" name="course">Chymistray
<input type="radio" name="course">Botany
<input type="radio" name="course">Zoolozy<br>
<input type="radio" name="course">Matchs
<input type="radio" name="course">Civics
<input type="radio" name="course">Arts
<input type="radio" name=""course">Commerce

8
4.select those of the following you have inserted in<br>
<input type="checkbox" name="dance">Dance
<input type="checkbox" name="speech">Public speaking
<input type="checkbox" name="drama">Drama
<input type="checkbox" name="reading">reading novels
<input type="checkbox" name="writing">Writing
<input type="checkbox" name="watch sport">Watching sports
<input type="checkbox" name="play sports">Playing sports

5.were you a number of either of the following?<br>


<input type="checkbox" name="ncc">National cadet corps
<input type="checkbox" name="nss">National Service Scheme<br><br>
<input type="Reset " value="start over">
<input type="Submit" value="send please">
</form>
</body> </html>
output:
application form for admission to the undergraduate program
1.Name of the application
2.Address:Street Town state
3.Course:applied for: Computer scince physics
chymistray Botany Zoolozy
Matchs civics Arts commarce 4.select those of the
following you have inserted in
Dance Public speaking Drama reading novels Writing
Watching sports Playing sports 5.were you a number of either
of the following?
National cadet corps National Service Scheme

9
6.write a html program for some states in India using frames.
Frame.html

<html>
<head>
<title> States INDIA
</title> </head>
<frameset cols="30%,70%">
<frame src="india.html" name="frame1">
<frame src="details.html" name="frame2">
</frameset>
</html>

india.html
<html>
<head>
<h1 align="center"> STATES IN INDIA </h1></center>
<title> STATES IN INDIA </title>
</head>
<body bgcolor="pink">
<center>
<h3> click any one of the following </h3>
<ul>
<li><a href="Kerala.html" target="frame2"> kerala </a>
<li><a href="Tamilanadu.html" target="frame2"> Tamilanadu</a>
<li><a href="Karnataka.html" target="frame2"> Karnataka</a>
<li><a href="Andhra.html" target="frame2"> Andhra</a>
</ul>
</body>
</html>

Details.html:-
<html>
<head><h1 align="center"> Details</h1>
<title> Details</title>
</head>
<body bgcolor="gold">
<p>click anyane of the following choice</p>
</body>
</html>

10
Kerala.html
<html>
<head><h1 align="center">kerala></h1>
<body bgcolor="green">
<ol>
<li>The capital of Kerala is TRIVANDRAM
<li>The main language in Kerala isMALAYALAM
</ol>
</body></html>

Tamilnadu.html
<html>
<head><h1 align=”center”>TAMILANADU</h1>
<body bgcolor="green">
<ol>
<li>The capital of TAMILANADU is CHEENI
<li>The main language in TAMILANADU is TAMIL
</ol>
</body></html>

Karnataka.html
<html>
<head><h1 align=center>KARNATAKA</h1>
<body bgcolor="green">
<ol>
<li>The capital of KARNATAKA is BANGLORE
<li>The main language in BANGLORE is KANNADA
</ol>
</body>
</html>

Andhra.html
<html>
<head><h1 align=center> ANDHRA</h1>
<body bgcolor="green">
<ol>
<li>The capital of ANDHRA is HYDERBAD
<li>The main language in ANDHRA is TELUGU
</ol>
</body>
</html>

11
Output:-
STATES IN INDIA
click any one of the following
kerala
Tamilanadu
Karnataka
Andhra

Java Script programs

7. write a Java script programme to test given number positive or negative

<html>
<head>
<title>Positive-Negative</title>
<Script language="javaScript">
var x;
x=window.prompt("enter a number"," ");
x=parseInt(x);
if(x>0)
{
document.writeln(x+"is a possitive number");
}
else
{
document.writeln(x+"is a Negative number");
}
</script>
</head>
<body bgcolor="skyblue">
<br>press F5
</body>
</html>

OUTPUT:-

Press f5

12
7. Write a java script programme to write code for multiplication table.

<html>
<head>
<script language="javaScript">
function table()
{
i=(document.f.t1.value);
for(n=1;n<=10;n++)
{
document.writeln(i,"*",n,"=",i*n,"<br>");
}
}
</script>
</head>
<body bgcolor="red">
<form name=f>
Enter n:<input type=text name=t1>
<input type="button" value="Gettable" onclick="table()">
</form>
</body>
</html>

Output:-

Top of Form

25
Enter n:
Bottom of Form
Top of Form
25*1=25
25*2=50
25*3=75
25*4=100
25*5=125
25*6=150
25*7=175
25*8=200

13
25*9=225
25*10=250

9. Write a java script programme to test the biggest of two numbers.

<html>
<head>
<title>Biggest of two numbers</title>
<script language="javascript">
var x,y;
x=window.prompt("enter a number"," ");
y=window.prompt("enter a number"," ");
x=parseInt(x);
y=parseInt(y);
if(x>y)
{
document.writeln(x+"is Biggest");
}
else
{
document.writeln(y+"is Biggest");
}
</script>
</head>
<body bgcolor="green">
<br>pressF5
</body>
</html>

Output:-
pressF5

14
10. Write a java script programme to test given number is Even and Odd.

<html>
<head>
<title>Even-Odd</title>
<Script language="JavaScript">
var x;
x=window.prompt("enter a number");
x=parseInt(x);
if (x%2==0)
{
document.writeln(x+"is a Even number");
}
else
{
document.writeln(x+"is a Odd number");
}
</Script>
</head>
<body bgcolor="gold">
<br>press F5
</body>
</html>

Output;-
press F5

456is a Even number


199is a Odd number

15
11. Write a HTML code for finding factorial of given Integer using
Java Script page coding.

<html>
<head>
<title>recursive factorial function</title>
<script language="javascript">
document.writeln("<table border=1 width=100%>");
for(var i=0;i<=10;i++)
document.writeln("<tr><td>"+i+"!</td><td>"+factorial(i)+"</td></tr>");
function factorial(number)
{
if(number<=1)
return 1;
else
return number*factorial(number-1);
}
</script>
</head>
</html>

Output:-
0! 1
1! 1
2! 2
3! 6
4! 24
5! 120
6! 720
7! 5040
8! 40320
9! 362880
10! 3628800

16
12. write a java script program to find the Students grade and details.
<html><head>
<title>Student program</title>
<script language="javascript">
var idno=window.prompt("enter idno"," ");
var name=window.prompt("enter a name"," ");
var tm=window.prompt("enter a telugu marks "," ");
var em=window.prompt("enter a english marks "," ");
var hm=window.prompt("enter a hindi marks "," ");
var mm=window.prompt("enter a maths marks "," ");
var sm=window.prompt("enter a scince marks "," ");
var tot=parseInt(tm)+parseInt(em)+parseInt(hm)+parseInt(mm)+parseInt(sm);
var avg=tot/5;
if(avg>=80)
{
grade="A";
}
else
{ if(avg>=60)
{
grade="B";
}
else
{ if(avg>=50)
{
grade="c";
}
else
{
grade="D";
}
}
}
document.writeln("<br>IDNO="+idno);
document.writeln("<br>NAME="+name);
document.writeln("<br>Total="+tot);
document.writeln("<br>Average="+avg);
document.writeln("<br>GRADE="+grade);
</script></head>
<body bgcolor="green" text="white">
17
<br>student is good boy
</body></html>

Output:-

IDNO=100
NAME=ramu
Total=341
Average=68.2
GRADE=B
student is good boy.

13. Write HTML CODE using JSP Arrays.


<html>
<head>
<title>linear search of an array</title>
<script language="javascript">
var a=new Array(100);
for(var i=0;i<a.length;i++)
a[i]=2*i;
for(var i=0;i<a.length;i++)
document.writeln(a[i]+" ");
function buttonpressed()
{
var sk=sform.iv.value;
var k=linearsearch(a,parseInt(sk));
if(k!=-1)
sform.r.value="found value in array at location="+k;
else
sform.r.value="value not found";
}
function linearsearch(ta,key)
{
for(var n=0;n<ta.length;n++)
if(ta[n]==key)
return n;
return -1;
}
</script>
</head>
<body>
<form name="sform" action=" ">
<p>enter integer search key<br>
18
<input name=iv type="text">
<input name=sr type="button" value="search" onclick="buttonpressed()"><br>
</p>

<p>result<br>
<input name=r type="text" size=30></p>
</form>
</body>
</html>

Output:-

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52
54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102
104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138
140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174
176 178 180 182 184 186 188 190 192 194 196 198
Top of Form
enter integer search key

result

Bottom of Form
Top of Form
enter integer search key

result

Bottom of Form

19

You might also like