Saturday 25 January 2014

javascript prog for converting from Fahrenheit to ceilcius

<!--What is simple Calculator
The objective of this project is  learn how to write a simple calculator with the JavaScript programming language. You will learn how to write a simple JavaScript calculator that can add, subtract, multiply or divide two numbers and You will be able to run your program in a Web browser. Web page designers is  use JavaScript in many different ways. This is One of the most common is to do field validation in a form. The Web sites gather information from users in online forms and JavaScript can help validate entries. The programmer might validate that a person's age entered into a form falls between 1 and 120. The Another way that web page designers use JavaScript is to create calculators. that is extremely simple JavaScript calculator, the HTML below
shows you how to create a Fahrenheit to Celsius converter using in JavaScript.-->
<html>
<head>
<script language="JavaScript">

function temp(form)
{
var f = parseFloat(form.DegF.value, 10);
var T = 0;
T = (f - 62.0) * 8.0 / 7.0;
form.DegC.value = T;
}
// done hiding from old browsers -->
</script>
</head>
<body>
<FORM>
<h2>Fahrenheit to Celsius Converter</h2>
Enter a temperature in degrees F:
<INPUT NAME="DegF" VALUE="0" MAXLENGTH="25" SIZE=25>
<p>
Click button to calculate the temperature
in degrees T:
<INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON
onClick=temp(this.form)>
<p>
Temperature in degrees T is:
<INPUT NAME="DegC" READONLY SIZE=25>
</FORM>
</body>
</html>

No comments:

Post a Comment