Solution Review: Temperature Conversion

Let’s go over the solution for the challenge: Temperature Conversion.

We'll cover the following

Task

In this challenge, you were provided with a variable that stored the temperature in degrees Fahrenheit and you were asked to convert it to degrees Celsius.

Solution

The formula used for converting temperatures from degrees Fahrenheit to Celsius is:

(fahrenheit - 32) * 5 / 9

All you had to do was rewrite celsius and assign to it the conversion formula above.

var celsius = (fahrenheit - 32) * 5 / 9;

You can find the complete solution below:

You were required to write the code given on line 3.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy