Sunday, 7 September 2014

dynamic result card

<html>
<head>
<title>Result Card</title>

<script>
sr=1;

rollno=prompt("Type Your RollNo","");
name=prompt("Type Your Name","");
english=prompt("Type Your English Marks","");
math=prompt("Type Your Math Marks","");
urdu=prompt("Type Your Urdu Marks","");
total=300;
obtained=eval(english)+eval(math)+eval(urdu);
percentage=obtained*100/total;

if(percentage>30)
{
ans="Pass";
}
else
{
ans="Fail";
}

check=confirm("Are You Sure");
if(check==true)
{
document.write("<tabke>");
}
else
{
document.write("Result Not found");
}

document.write(check);
</script>
</head>
<!--
<body>
<h1 align="center">Result Card</h1>
<table border="1" width="400" align="center">

<tr>
<td width="100">Sr#</td>
<td><script>document.write(sr);</script></td>
</tr>

<tr>
<td>Roll No</td>
<td><script>document.write(rollno);</script></td>
</tr>

<tr>
<td>Name</td>
<td><script>document.write(name);</script></td>
</tr>


<tr>
<td>English</td>
<td><script>document.write(english);</script></td>
</tr>


<tr>
<td>math</td>
<td><script>document.write(math);</script></td>
</tr>

<tr>
<td>urdu</td>
<td><script>document.write(urdu);</script></td>
</tr>

<tr>
<td>Total Marks</td>
<td><script>document.write(total);</script></td>
</tr>

<tr>
<td>Obtained Marks</td>
<td><script>document.write(obtained);</script></td>
</tr>

<tr>
<td>Percentage</td>
<td><script>document.write(percentage);</script></td>
</tr>

<tr>
<td>Pass/Fail</td>
<td><script>document.write(ans);</script></td>
</tr>
</table>
</body>
-->
</html>

No comments:

Post a Comment