Hello

I need help with a exercice, is about Kelvin celsius, thank you
The forecast today is 293 Kelvin. To start, create a variable named kelvin, and set it equal to 293.

The value saved to kelvin will stay constant. Choose the variable type with this in mind.

Stuck? Get a hint

Write a comment above that explains this line of code.

Stuck? Get a hint

Celsius is similar to Kelvin — the only difference is that Celsius is 273 degrees less than Kelvin.

Let’s convert Kelvin to Celsius by subtracting 273 from the kelvin variable. Store the result in another variable, named celsius.

Stuck? Get a hint

Write a comment above that explains this line of code.

Use this equation to calculate Fahrenheit, then store the answer in a variable named fahrenheit.

Fahrenheit = Celsius * (9/5) + 32

In the next step we will round the number saved to fahrenheit. Choose the variable type that allows you to change its value.

Stuck? Get a hint

Write a comment above that explains this line of code.

When you convert from Celsius to Fahrenheit, you often get a decimal number.

Use the .floor() method from the built-in Math object to round down the Fahrenheit temperature. Save the result to the fahrenheit variable.

Stuck? Get a hint

Write a comment above that explains this line of code.

Use console.log and string interpolation to log the temperature in fahrenheit to the console as follows:

The temperature is TEMPERATURE degrees Fahrenheit.

Use string interpolation to replace TEMPERATURE with the value saved to fahrenheit.

Stuck? Get a hint

Run your program to see your results!

If you want to check your work, open the hint.

Stuck? Get a hint

By using variables, your program should work for any Kelvin temperature — just change the value of kelvin and run the program again.

What’s 0 Kelvin in Fahrenheit?

Stuck? Get a hint

Great work! Kelvin can now publish his forecasts in Celsius and Fahrenheit.

If you’d like extra practice, try this:

  • Convert celsius to the Newton scale using the equation below

Newton = Celsius * (33/100)

  • Round down the Newton temperature using the .floor() method
  • Use console.log and string interpolation to log the temperature in newton to the console

Hi @yen_romard!
Can you be more specific with your question? Perhaps post the code you have created with questions about the code?

Otherwise it is very difficult to know where to help.

Thanks!