BMI calculations
<p>The formula for calculating body mass index is weight * 703 / height². 
Create a web page that contains three text boxes: weight in pounds, height in inches, and one that will contain the BMI result. Create a script with a function named calcBMI() that performs the calculation using the values in the weight and height text boxes and assign the result of the BMI text box. Convert the result to an integer by using the parseInt() function. Reference the text boxex from within the function by using the document object, form name, and name and value attributes of each text box (don’t use function arguments). Perform the calculation by calling the function from onclick event in a button element.</p>

<p>This what I could come up with:</p>

<pre><code>&lt;html&gt;&lt;head&gt;
&lt;title&gt;...&lt;/title&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt;

&lt;script type="text/javascript"&gt;
/*&lt;CDATA[[*/

function calcBMI(){
var weight, height, total;
document.form.height.value = weight * 703;
document.form.weight.value = (height * height);
var total = weight / height;
document.form.result.value = total;
}
/*]]&gt;*/
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="form"&gt;
Weight: &lt;input type="text" name="weight" /&gt;&lt;br /&gt;
Height: &lt;input type="text" name="height" /&gt;&lt;br /&gt;
Result: &lt;input type="text" name="result" /&gt;&lt;br /&gt;
&lt;input type="button" value="BMI Result!" onclick="calcBMI()" /&gt;
&lt;/form&gt;
</code></pre>
