java scripts examples

Attendence Summary
<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!!! ","
",l,"%","
","You need ",m,"% more to sit in Examination");
}
else
{
document.write("Your Attendence is ",l,"%","
","You're eligible for examination");
}
}
<button onclick="AS();">Click here to calculate your Attendence

program 2:
TABLE
<script type="text/javascript">
var i,j;
var n=parseInt(prompt("enter the number of row"));
document.write(""); "); "); "); ");
for(i=1;i<=n;i++)
{
document.write("
document.write("A",i,"
for(j=1;j<=n;j++)
{
document.write("rishabh");
document.write("punkit");
document.write("
}
document.write("
}
document.write("
");
java script not active

0 comments:

Post a Comment