Question: HTML form Tag function calculate() { 'use strict'; // For storing the volume: var volume; var seleced; // Get a reference to the form value:
function calculate()
{
'use strict';
// For storing the volume:
var volume;
var seleced;
// Get a reference to the form value:
var radius = document.getElementById('radius').value;
var height = document.getElementById('height').value;
var unit = document.getElementById('unit');
var shape = document.getElementById('shape');
for (Count = 0; Count
{
if (theForm.unit[Count].checked)
selected = theForm.unit[Count];
break;
}
document.getElementById('unit').innerHTML = selected.text;
document.getElementById('shape').innerHTML = shape.options[shape.selectedIndex].text;
// Make sure radius & height is positive:
radius = Math.abs(radius);
height = Math.abs(height);
// Perform the calculation:
if(shape[shape.selectedIndex].value=="Sphere"){
volume = (4/3) * Math.PI * Math.pow(radius, 3);
}
else if(shape[shape.selectedIndex].value=="Cylinder"){
volume = Math.PI * Math.pow(radius, 2) * height;
}
else if(shape[shape.selectedIndex].value=="Cone"){
volume = Math.PI * Math.pow(radius, 2) * (height/3);
}
// Format the volume:
volume = volume.toFixed(4);
return false;
}
Your task: This assignment is to get you familiar with forms and form validation. Design, a very basic HTML web page with both form tags and a JavaScript code that will allow the user to calculate the Volume for a cylinder, sphere or cone and output the results in either English or SI units. The web page must:
(1) Allow the user to select either English or SI units with the use of a radio button selection.
(2) Allow the user to select the shape with a pull down menu
(3) Allow the user to enter the radius and height values in separate text box
(4) Once the data is collected have a button tag that will activate a JavaScript that will read the form data and return the input data. The Units and shape selection should be displayed as shown below.
(5) The Shape, radius and height data must be displayed in a table.
(6) The script should calculate the Volume based on the input data and display these results in the table.
Here is a sample page as a guide

Above the code has a problem with table (
)
I don't know how to display the radius value and volume in the table. please tell me about it
Your task: This assignment is to get you familiar with forms and form validation, Design, a very besic HTML web page with both form tags and a JavaScript code that will allow the uscr to calculate the Volume for a cylinder, sphere conc and output the results in cither English or SI units. The wcb page should (1) Allow the user to select cither English or SI units with the use of a radio button selection. (2) Allow the user to select the shape with a pull down menu (3) Allow the user to enter the radius and height values in separate text box (4) Once the data is collected have a button tag that will activate a javascript that will read the form data and return the input data. The Units and shape selection should be displayed as shown below. (5) The Shape, radius and height data must be displayed in a table. (6) The script should calculate the Volume based on the input data and display these results in the table. Here is a sample printout as a guide. This web site will find the volume for a Cylinder, Sphere or Cone Select the units English or ST Select the shape Cone Einter the eadas 2 For the cyindet and cone Enner the heighe 2 Results You selected to sse Eriatish tnrts Shape Radves Heght Volume th 3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
