0% found this document useful (0 votes)
19 views13 pages

Webapp File 12 Odt

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

Webapp File 12 Odt

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 13

ONE

<html><head>
<script>
function evenodd()
{
n1=parseInt(document.f1.txt1.value)
if(n1%2==0)
document.f1.txt2.value="Even"
else
document.f1.txt2.value="Odd"
}
</script>
</head>
</body>
<form name=f1>
Enter an Integer:<input name=txt1>
<input type=button Value=Check name=check onclick=evenodd()>
<br><br>
Even/Odd: <input name=txt2>
</form>
</body>
</html>

Output

TWO

<html><head>
<script>
function cal()
{
n1=parseInt(document.f1.txt1.value)
n2=parseInt(document.f1.txt2.value)
n3=parseInt(document.f1.txt3.value)
n4=n1*n2*n3/100
document.f1.txt4.value=n4
}
</script>
</head>
</body>
<form name=f1>
Enter Principal:<input name=txt1>
<br><br>
Enter rate:<input name=txt2>%p.a
<br><br>
Enter time:<input name=txt3>
<br><br>
<input type=button Value="Calculate Simple Interest"
name=calc onclick=cal()>
<br><br>
Simple Interest:<input name=txt4>
</form>
</body>
</html>
Output

Three

<html>
<script>
function add()
{
n1=parseInt(document.form1.txt1.value)
n2=parseInt(document.form1.txt2.value)
document.form1.txt3.value=n1+n2
}
function sub()
{
n1=parseInt(document.form1.txt1.value)
n2=parseInt(document.form1.txt2.value)
document.form1.txt3.value=n1-n2
}
function mul()
{
n1=parseInt(document.form1.txt1.value)
n2=parseInt(document.form1.txt2.value)
document.form1.txt3.value=n1*n2
}
function div()
{
n1=parseInt(document.form1.txt1.value)
n2=parseInt(document.form1.txt2.value)
document.form1.txt3.value=n1/n2
}
function mod()
{
n1=parseInt(document.form1.txt1.value)
n2=parseInt(document.form1.txt2.value)
document.form1.txt3.value=n1%n2
}
</script>
<body>
<h1> Arithmetic Calculator </h1><form name=form1>
Enter First Number<input type=text name=txt1 value=0>
<br> <br>
Enter Second Number<input type=text name=txt2 value=0>
<br><br>
<input type=button name=addition value=+ onclick=add()><input type=button
name=subtraction value=- onclick=sub()>
<input type=button name=multiplication value=* onclick=mul()>
<input type=button name=division value=/ onclick=div()>
<input type=button name=modulo value=% onclick=mod()>
<br><br>
result<input type=text name=txt3 value=0>
</form>
</body>
</html>
Output

FOUR

<html>
<head>
<script>
function num()
{
n1=parseInt(document.f1.start.value)
n2=parseInt(document.f1.end.value)

s=''
for(i=n1+1;i<=n2-1;i++)
s=s+i+''

document.getElementById("p1").innerHTML=s
}
</script>
<body>
<form name=f1>
To diplay the numbers between two given numbers
<input name=start>
and <input name=end>
<p id="p1"> </p>
<br><br>
<input type=button value="Display" onclick=num()>
</form>
</body>
</html>
Output
Five

<script>
n1=parseInt(prompt("Enter n1:"))
n2=parseInt(prompt("Enter n2:"))
n3=parseInt(prompt("Enter n3:"))
n4=parseInt(prompt("Enter n4:"))
n5=parseInt(prompt("Enter n5:"))
sum=n1+n2+n3+n4+n5
alert(sum)
</script>

six
Code
<html>
<script>
function bw()
{
n1=document.f1.txt1.value
n2=document.f1.txt2.value
r=document.f1.r1.value
if(r=="m")
alert("Mr."+n1.charAt(0)+"."+n2+",for visiting our
website.")
else
alert("Thank you Ms."+n1.charAt(0)+"."+n2+",for visiting
our website.")
}
</script>
<body>
<form name=f1>
First Name<input name=txt1>
<br><br>
Last Name<input name=txt2>
<br><br>
Gender
<br><br>
Male<input type=radio name=r1 value="m">
<br><br>
Female<input type=radio name=r1 value="f">
<br><br>
<input type=button value="Show Me" name=show
onclick=bw()>
</body>
</form>
</html>

7
Code

<html>
<body>
<form name=f1>
Go to <input type=radio
onclick=opensite("https://www.cbse.gov.i
n") name=r1> CBSE
<input type=radio
onclick=opensite("https://www.ncert.nic.i
n") name=r1> NCERT
<input type=radio
onclick=opensite("https://www.moe.edu.k
w) name=r1> MOE,Kuwait
</form>
</body>
<script>
function opensite(s)
{
open(s,target="_Self")
}
</script>
</html>
eight
Code
<html>
<head>
<script>
function cal()
{
n1=parseInt(document.f1.txt1.value)
n2=parseInt(document.f1.txt2.value)
n3=parseInt(document.f1.txt3.value)
n4=n1*n2*n3/100
document.f1.txt4.value=n4
document.f1.txt5.value=n1+n4
}
function calc()
{
n1=parseInt(document.f1.txt1.value)
n2=parseInt(document.f1.txt2.value)
n3=parseInt(document.f1.txt3.value)
n4=n1*(1+n2/100)^n3
document.f1.txt4.value=n4-n1
document.f1.txt5.value=n4
}
</script>
</head>
</body>
<form name=f1>
Principal Amount:<input name=txt1>
rate:<input name=txt2>
time:<input name=txt3>
<br><br>
Interest Type
<br><br>
<input type=radio name=r1> Simple Interest
<input type=radio name=r1> Compound Interest
<hr>
Interest:<input name=txt4>
Total Amount:<input name=txt5>
<br><br>
<input type=button value="Calculate"
onclick=cal()>
<input type=button value="Clear" onclick=calc()>
</form>
</body>
</html>
Output

You might also like