Social Icons

banner image

java scripts examples

<! DOCTYPE html>
<html>
<head>
<title>
Attendence Summary
</title>
</head>
<script type="text/javascript">
function AS()
{
var a=parseInt(prompt("Enter the attended lectures of CSE"));
var b=parseInt(prompt("Enter the delivered lectures of CSE"));
var c=parseInt(prompt("Enter the attended lectures of MTH"));
var d=parseInt(prompt("Enter the delivered lectures of MTH"));
var e=parseInt(prompt("Enter the attended lectures of PEV"));
var f=parseInt(prompt("Enter the delivered lectures of PEV"));
var g=parseInt(prompt("Enter the attended lectures of INT"));
var h=parseInt(prompt("Enter the delivered lectures of INT"));
var i=parseInt(prompt("Enter the attended lectures of MEC"));
var j=parseInt(prompt("Enter the delivered lectures of MEC"));
var k=(a+c+e+g+i)*100;
var l=k/(b+d+f+h+j);
if (l<75)
{
var m=75-l;
document.write("Attendence is LOW!!! ","<br>",l,"%","<br>","You need ",m,"% more to sit in Examination");
}
else
{
document.write("Your Attendence is ",l,"%","<br>","You're eligible for examination");
}
}
</script>
<body>
<button onclick="AS();">Click here to calculate your Attendence</button>
</body>
</html>
program 2:
<!doctype html>
<html>
<head>
<title>TABLE</title>
<script type="text/javascript">
var i,j;
var n=parseInt(prompt("enter the number of row"));
document.write("<table border=2>");
for(i=1;i<=n;i++)
{
document.write("<tr>");
document.write("<th>A",i,"</th>");
for(j=1;j<=n;j++)
{
document.write("<td>rishabh");
document.write("<td>punkit");
document.write("</td>");
}
document.write("</tr>");
}
document.write("</table>");
</script>
<noscript>java script not active</noscript>
</head>
</html>
java scripts examples java scripts examples Reviewed by Shobhit Goel on December 02, 2015 Rating: 5

No comments:

Airtel Hackaton 2017

Powered by Blogger.