Select Page
This image has an empty alt attribute; its file name is Cover-Pic.png

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