PDA

View Full Version : i have an over due assignment >< help!


.Ruski
03-11-2009, 10:38 PM
its the only part of the assignment i havent done, and it was due last tuesday ><
i know people will say we wont do ur homework for u etc. but please jst this once. heres what i have to do :

Metric Conversion. create a blank web page that has a pop-up prompt for “Feet” and another for “and Inches” which then produces a pop-up message “(value) metres or (value) centimetres”, where each value is the metric conversion of the total of feet and inches. (Note: use 12 inches per foot, 2.54 centimetres per inch, and 100 centimetres per metre. If the user inputs 5 feet and 6 inches the output should be “1.6764 metres or 167.64 centimetres”.)


the link to the assignment is here

http://borderline09.nciwiki.com.au/file/view/ICAB4225B_ICAB4137B_1of2_200901_KC_V1.docx

the most i've managed to do is make the popup box using:
var feet = prompt("Feet?");
var inches = prompt("inches?");

although i need it to display the feet and inches as meters and centimetres on the page once the numbers have been put in...


i'll greatly appreciate anyones help.
thanks.

Makawak
04-29-2009, 03:21 PM
Has your professor given you an extension on this and if so when to?

I have no problem helping and walking you through it, but I wont do it for you. Not to mention if there is no extension and its been over a week then this would get a failing grade anyways.

Kirth
03-21-2010, 03:24 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Turtles are damned well Rad, yo.</title>
<script type="text/javascript">
var feet = parseFloat(prompt("Feet?"));
var inches = parseFloat(prompt("'n Inches?"));

var total_inches = inches + (feet * 12);

function to_metres(value)
{
return 0.0254 * value;
}

function to_cm(value)
{
return 2.54 * value;
}

alert(to_cm(total_inches) + "cm or " + to_metres(total_inches) + "m.");

</script>
</head>

<body>
</body>
</html>