I need help!


#1

const kelvin = 294;
const celsius = kelvin - 273;
let fahrenheit = celsius * (9/5) + 32;
const fahrenheit = Math.floor(fahrenheit);
console.log(‘The temperature is ${fahrenheit} degrees fahrenheit.’);
const kelvin = prompt('What is the Kelvin temperature today?’)

I can not find my mistake…


#2

Please remember to include a link to the exercise when starting a new topic relating to the lesson. (Copy the URL in the location bar and paste it into a post.)

LEARN JAVASCRIPT: INTRODUCTION - Kelvin Weather


#3

You have already defined fahrenheit with let so this line should just set the value…

fahrenheit = Math.floor(fahrenheit);

The exercise says to replace const kelvin's value with a prompt so the last line should be at the top.

Once we define a variable as a const we cannot change it. Edit the first line.

If you enter 0 at the prompt, the result in the console should be,

The temperature is 32 degrees Fahrenheit.

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.