Task of Challenge #08/54
Create a function that will convert from Celsius to Fahrenheit. Convert 0 degree Celsius.
Solution
Explanation
How to convert Celsius to Fahrenheit
The temperature T in degrees Fahrenheit (°F) is equal to the temperature T in degrees Celsius (°C) times 9/5 plus 32:
T(°F) = T(°C) × 9/5 + 32
or
T(°F) = T(°C) × 1.8 + 32
Example
Convert 20 degrees Celsius to degrees Fahrenheit:
T(°F) = 20°C × 9/5 + 32 = 68 °F
To accomplish our task, we need to return a number calculated with 1.8 and add 32 to it.
This is done in the convertCelsiusToFahrenheit
-function.
Just return the number and print it out, and you are done!
The console prints out 32 when we put in the number 0
.
Follow me on Instagram and don’t miss the latest Challenge!
https://www.instagram.com/arnold.code/
Become a bullet proof developer and seek my coding adventures on Udemy
https://www.udemy.com/user/arnold-abraham-3/
Don’t miss two of my most read Medium Articles
5 Methods that drastically shorten drastically your Code in C# 8.0 by @ArnoldAbrahamP1 https://t.co/UlTW3H7bD9
— Kumpulin1 (@kumpulin1) May 5, 2021
The reasons not to migrate from JavaScript to TypeScript! by @ArnoldAbrahamP1 https://t.co/tTjG6XG2nC #typescript #javascript #softwaredevelopement
— NFT (@nerdfortech) April 20, 2021