DESIGN A HTML HOMEPAGE TO CALCULATE PERCENTAGE OF A STUDENT

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>PROBLEM : DESIGN A HTML HOMEPAGE TO CALCULATE PERCENTAGE
	OF A STUDENT</title>
</head>
<body>

	<b>PROBLEM : DESIGN A HTML HOMEPAGE TO CALCULATE PERCENTAGE OF A
		STUDENT</b>

	<b>CODE :</b> Form
	<script type="text/javascript">
		function call() {
			var a = form.f1.value;
			var b = form.f2.value;
			var c = form.f3.value;
			var d = form.f4.value;
			var e = form.f5.value;
			var f = form.f6.value;
			var g = form.f7.value;
			var h = parseInt(c) + parseInt(d) + parseInt(e) + parseInt(f)
					+ parseInt(g);
			var i = parseInt(h) / 5;

			document.getElementById("tab").innerHTML = "<table align=center border=1></p><tr></p><td>Name</td><p></p><td>Roll No</td><p></p><td>Subject 1 Marks</td><p></p><td>Subject 2 Marks</td><p></p><td>Subject 3 Marks</td><p></p><td>Subject 4 Marks</td><p></p><td>Subject 5 Marks</td><p></p><td>Total</td><p></p><td>Percentage</td><p></tr><p></p><tr></p><td>"+a+"</td><p></p><td>"+b+"</td><p></p><td>"+c+"</td><p></p><td>"+d+"</td><p></p><td>"+e+"</td><p></p><td>"+f+"</td><p></p><td>"+g+"</td><p></p><td>"+h+"</td><p></p><td>"+i+"</td><p></tr><p></table>";
		}
	</script>
	<h1 align="center">Student's MarkSheet</h1>
	&nbsp;

	<form name="form">
		Student's Name:<input name="f1" type="text" /> <br> Roll No.: <input
			name="f2" type="text" value="" /> <br> Subject 1 Marks: <input
			name="f3" type="text" value="" /> <br> Subject 2 Marks:<input
			name="f4" type="text" value="" /> <br> Subject 3 Marks:<input
			name="f5" type="text" value="" /> <br> Subject 4 Marks:<input
			name="f6" type="text" value="" /><br> Subject 5 Marks:<input
			name="f7" type="text" value="" /> <input type="button"
			value="Result" onclick="call();"/> <input name="r" type="RESET" />

		<table align="center">
			<tbody>
				<tr>
					<td>Roll No.</td>
				</tr>
			</tbody>
		</table>
		&nbsp;
		<div id="tab"></div>
		&nbsp;

	</form>

</body>
</html>

 

OUTPUT
DESIGN A HTML HOMEPAGE TO CALCULATE PERCENTAGE OF A STUDENT