Friday 31 January 2020

WT-1


Slip1

Q1. Write a JavaScript program to calculate the volume of a sphere.                                       

<html>
<script>
function volume()
{
var t_val=document.getElementById("txt").value;
var rad=parseInt(t_val);
var vol=(4.0/3.0)*Math.PI*Math.pow(rad,3);
document.getElementById('volume').value=vol;
}
</script>
</head>
<body>
<table border="1">
<tr><td>Enter the radius of Sphere: </td><td><input type="text" id="txt" size="30"/></td></tr>
<tr><td>Volume</td><td><input type="text" name="volume" id="volume"></td></tr>
<tr><td> </td><td><input type="submit" value="Calculate" onclick="volume()"></td></tr>
</table>
 </body>

</html>

Q2. Create HTML page to Divide the frames in to different sections as shown below and add appropriate HTML files to each frame.               

frames.html

<html>

<frameset rows="30%,*">
<frame src="header.html" name="f1">

<frameset rows="30%,70%" cols="50%,50%">
<frame src="link.html" name="f2">
<frame src="pune.html" name="f3">

<frameset cols="30%,30%">
<frame src="b.html" name="f4">
<frame src="2.html" name="f5">
</frameset>

<frame src="3.html" name="f6">

</frameset>
</frameset>

</html>


header.html

<html>
<body>
<b>First Frame :</b><br>
Your Name and address</BODY>
</HTML>


link.html

<html>
<body>
<b>Second Frame :</b><br>
Bulleted list of favourite colours
</body>
</html>



pune.html

<html>
<body>
<b>Third Frame :</b><br>
Numbered List of Cities
</body>
</html>


b.html
<html>
<body>
<b>Fourth Frame:</b><br>
Scrolling Message
</body>
</html>

2.html
<html>
<body>
<b>Fifth Frame:</b><br>
Blinking Reminders
</body>
</html>

3.html
<html>
<body>
<b>Sixth Frame:</b><br>
Name of Countries
</body>
</html>