Sunday, 7 September 2014

Pass/Fail

<html>
<head>
<title>welcome</title>

<script>
sr=1;
rollno="W-21212";
name="Asif";
eng=90;
urdu=18;
math=15;
total=300;

obtained=math+urdu+eng;
per=obtained*100/total;
if(per>40)
{
ans="Pass";
}
else
{
ans="Fail";
}

</script>
</head>
<body>
<h1 align="center">Result Card</h1>
<table border="1" width="350" align="center">


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


<tr>
<td width="100">Roll No</td>
<td><script>document.write(rollno);</script></td>
</tr>


<tr>
<td width="100">Name</td>
<td><script>document.write(name);</script></td>
</tr>


<tr>
<td width="100">English</td>
<td><script>document.write(eng);</script></td>
</tr>


<tr>
<td width="100">Urdu</td>
<td><script>document.write(urdu);</script></td>
</tr>



<tr>
<td width="100">Math</td>
<td><script>document.write(math);</script></td>
</tr>




<tr>
<td width="100">Total Marks</td>
<td><script>document.write(total);</script></td>
</tr>


<tr>
<td width="100">Obtained Marks</td>
<td><script>document.write(obtained);</script></td>
</tr>


<tr>
<td width="100">Percentage</td>
<td><script>document.write(per);</script></td>
</tr>

<tr>
<td width="100">Pass/Fail
</td>
<td><script>document.write(ans);</script></td>
</tr>
</table>
</body>
</html>

No comments:

Post a Comment