Q1. Write a JavaScript program to calculate the volume of a sphere.
Answer :
<html>
<head>
<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('vol').value = vol;
}
</script>
</head>
<body>
<form>
<fieldset>
<legend>JavaScript Program</legend>
<table border="3" bgcolor="black" style="color: aliceblue;">
<tr>
<td style="padding:20 20 20 20">
<p>Input radius value and get the volume of a sphere.</p>
Radius <br><input type="text" id="txt"><br>
Volume <br><input id="vol" placeholder="0.0000000000"><br><br>
<input type="button" value="Find volume" onclick="volume()">
<button type="reset" value="Reset">Reset</button>
</td>
</tr>
</table>
</form>
</fieldset>
</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.
Answer :
file : 1.html
<frameset rows="*,*,*">
<frame src="frame_1.html">
<frameset cols="50%,50%">
<frame src="frame_2.html">
<frame src="frame_3.html">
</frameset>
<frameset cols="32%,*,32%">
<frame src="frame_4.html">
<frame src="frame_5.html">
<frame src="frame_6.html">
</frameset>
</frameset>
file : frame_1.html
<html>
<body>
</br>
<p> Name : Enter Your Name <p/>
</br>
<p> Address : Enter Your Address
</body>
</html>
file : frame_2.html
<html>
<body>
<ul>
<li style="color: #FF5733">Orange</li>
<li style="color:hsl(300, 100%, 70%)">Pink</li>
<li style="color:rgb(255, 204, 0)">golden</li>
</ul>
</html>
file : frame_3.html
<html>
<body>
<ol type="1">
<li>Kolkata</li>
<li>Chennai</li>
<li>Bangalore</li>
<li>Hyderabad</li>
<li>Ahmedabad</li>
<li>Pune</li>
<li>Surat</li>
<li>Jaipur</li>
<li>New Delhi</li>
<li>Jaipur</li>
</ol>
</body>
</html>
file : frame_4.html
<!DOCTYPE html>
<html>
<head>
<title>HTML marquee Tag</title>
</head>
<body>
<marquee><img src="source.gif" height="20" width="50">This is basic example of marquee</marquee>
</body>
</html>
file : frame_5.html
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<body>
<p> <img src="source.gif" height="20" width="50"> Web Technology BCA Notes </p>
</body>
</body>
</html>
file : frame_6.html
<! Doctype html>
<html>
<title>Assignment No.4 B1</title>
<body>
<ol type="1">
<li>Russia</li>
<li>Canada </li>
<li>China</li>
<li>United States</li>
<li>Brazil</li>
<li>Australia</li>
<li>India</li>
<li>Argentina</li>
<li>Kazakhstan</li>
<li>Sudan</li>
</ol>
</body>
</html>
No comments:
Post a Comment