Created
September 17, 2015 17:58
-
-
Save robertbenjamin/e7d44edfc76ee6212372 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function convert(temp) { | |
| // This takes the number you gave it (temp), converts it to celcius, then stores it in the celsius variable | |
| celsius = (temp - 32) / 1.8; | |
| // This prints the fahrenheit degree you gave it, and what the same degree is in celsius | |
| console.log(temp + " degrees Fahrenheit is " + celsius + " degrees in Celsius!") | |
| return celsius | |
| } | |
| // Now, I run the function above and put in the fahrenheit degress I want to convert | |
| convert(32) // This returns "32 degrees Fahrenheit is 0 degrees in Celsius!" | |
| convert(100) // This returns "100 degrees Fahrenheit is 37.77777777777778 degrees in Celsius!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment