--> Copy following code in your notepad file and save file name with .html
------------------------------------------------------------------------------------------------
<html>
<head>
<title>mark-sheet</title>
<script >
var s1,s2,s3,s4,s5,s6,s7,total,per,name,roll;
roll=prompt("enter the student roll no");
name=prompt("Enter the student name");
s1=parseInt(prompt("enter subject1 mark : " ));
s2=parseInt(prompt("enter subject2 mark : " ));
s3=parseInt(prompt("enter subject3 mark : " ));
s4=parseInt(prompt("enter subject4 mark : " ));
s5=parseInt(prompt("enter subject5 mark : " ));
s6=parseInt(prompt("enter subject6 mark : " ));
s7=parseInt(prompt("enter subject7 mark : " ));
total=s1+s2+s3+s4+s5+s6+s7;
per=total/7;
document.write(" <h1> <center> MARKSHEET </h1> </center>");
document.write(" <hr color=red> <hr color=red> ");
document.write(" <h3>Roll no : " + roll);
document.write(" <br> Name : " + name +"</h3>");
document.write(" <hr color=black>");
document.write(" <b> <br>       Subject        Mark </b>");
document.write(" <br>       Subject 1            " + s1);
document.write(" <br>       Subject 2            " + s2);
document.write(" <br>       Subject 3            " + s3);
document.write(" <br>       Subject 4            " + s4);
document.write(" <br>       Subject 5            " + s5);
document.write(" <br>       Subject 6            " + s6);
document.write(" <br>       Subject 7            " + s7);
if(s1<40 || s2<40 || s3<40 || s4<40 || s5<40 || s6<40 || s7<40)
{
document.write(" <hr color=black>");
document.write(" Total <b>: " + total + "<br>");
document.write("                              <font color=red > <h3>Fail </h3></font>");
}
else
{
document.write(" <hr color=black>");
document.write(" Total : " + total);
document.write(" <br> Percentage : " + per);
document.write(" <br> grade :");
if(per>=70)
{
document.write(" <b>Districation");
}
else if(per >=60)
{
document.write(" <b>First class");
}
else if(per>=48)
{
document.write(" <b>Second class");
}
else
{
document.write(" <b>pass class");
}
}
document.write(" <hr color=red> <hr color=red> ");
</script>
</head>
<body bgcolor=silver>
</body> </html>
--> then open this page in browser
------------------------------------------------------------------------------------------------
<html>
<head>
<title>mark-sheet</title>
<script >
var s1,s2,s3,s4,s5,s6,s7,total,per,name,roll;
roll=prompt("enter the student roll no");
name=prompt("Enter the student name");
s1=parseInt(prompt("enter subject1 mark : " ));
s2=parseInt(prompt("enter subject2 mark : " ));
s3=parseInt(prompt("enter subject3 mark : " ));
s4=parseInt(prompt("enter subject4 mark : " ));
s5=parseInt(prompt("enter subject5 mark : " ));
s6=parseInt(prompt("enter subject6 mark : " ));
s7=parseInt(prompt("enter subject7 mark : " ));
total=s1+s2+s3+s4+s5+s6+s7;
per=total/7;
document.write(" <h1> <center> MARKSHEET </h1> </center>");
document.write(" <hr color=red> <hr color=red> ");
document.write(" <h3>Roll no : " + roll);
document.write(" <br> Name : " + name +"</h3>");
document.write(" <hr color=black>");
document.write(" <b> <br>       Subject        Mark </b>");
document.write(" <br>       Subject 1            " + s1);
document.write(" <br>       Subject 2            " + s2);
document.write(" <br>       Subject 3            " + s3);
document.write(" <br>       Subject 4            " + s4);
document.write(" <br>       Subject 5            " + s5);
document.write(" <br>       Subject 6            " + s6);
document.write(" <br>       Subject 7            " + s7);
if(s1<40 || s2<40 || s3<40 || s4<40 || s5<40 || s6<40 || s7<40)
{
document.write(" <hr color=black>");
document.write(" Total <b>: " + total + "<br>");
document.write("                              <font color=red > <h3>Fail </h3></font>");
}
else
{
document.write(" <hr color=black>");
document.write(" Total : " + total);
document.write(" <br> Percentage : " + per);
document.write(" <br> grade :");
if(per>=70)
{
document.write(" <b>Districation");
}
else if(per >=60)
{
document.write(" <b>First class");
}
else if(per>=48)
{
document.write(" <b>Second class");
}
else
{
document.write(" <b>pass class");
}
}
document.write(" <hr color=red> <hr color=red> ");
</script>
</head>
<body bgcolor=silver>
</body> </html>
--> then open this page in browser
No comments:
Post a Comment