ColdFusion Tutorial

Temperature Conversion - Celsius to Fahrenheit - Fahrenheit to Celsius

Temperature Conversion - Celsius to Fahrenheit ? Fahrenheit to Celsius


Temperature Conversion - Celsius to Fahrenheit ? Fahrenheit to Celsius

Graphic Source: USA TODAY

Water freezes at 0? Celsius and boils at 100? Celsius which is a difference of 100?. Water freezes at 32? Fahrenheit and boils at 212? Fahrenheit which is a difference of 180?. Therefore each degree on the Celsius scale is equal to 180/100 or 9/5 degrees on the Fahrenheit scale.

There are no predefined functions in CFML for this, so we have to write some lines of code for it.


<!--- Celsius to Fahrenheit --->
<cfset Celsius_convert = 37>

<cfset Fahrenheit = (9/5) * #Celsius_convert# + 32>


<cfoutput>Celsius #Celsius_convert# = #Fahrenheit# Fahrenheit</cfoutput><br />

<!--- Fahrenheit to Celsius --->
<cfset Fahrenheit_convert = 98.6>

<cfset Celsius = (5/9) * (#Fahrenheit_convert# -32)>

<cfoutput>Fahrenheit #Fahrenheit_convert# = #Celsius# Celsius</cfoutput>


The output:

Celsius 37 = 98.6 Fahrenheit
Fahrenheit 98.6 = 37 Celsius

ColdFusion Tutorial test

Temperature Conversion - Celsius to Fahrenheit - Fahrenheit to Celsius

Celsius to Fahrenheit

Celsius Fahrenheit  


Fahrenheit to Celsius

Fahrenheit Celsius  

No User Comments.

No User Comments, be the first one to write your comments?

Add your comments

Your Name*:
Your Email:
Site URL:
Site Name:
Comemt Title*:
Your Comment*:
Key Phrase*:
dR8
Your IP Address: 38.103.63.62
 

ScandicWeb is own by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.

[Home [Site Map [Privacy Statement [Site Feedback] [About ScandicWeb]


[ColdFusion [Flash [Search Engine Optimization [Graphics [Cascading Style Sheets (CSS) [JavaScript (JS) [Software]

Partner sites: ScandicSoft


Server time: 19. November 2008 Wednesday