Need Some Help


#1

const kelvin = 294;
const Celsius = kelvin - 273;
const 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 keep on running this error:
SyntaxError: redeclaration of const Fahrenheit


#2

here:

const Fahrenheit = Celsius *(9/5) + 32;

you declare a variable Fahrenheit, then you re-assign Fahrenheit:

const Fahrenheit = math.floor(Fahrenheit);

when re-assigning, you shouldn’t use const keyword

constants can’t be re-assigned, if you want to re-assign a variable, the variable should be declared with let


#3

I had the same issue - you need to change

const kelvin = 294;

to

const kelvin = prompt(‘What is the Kelvin temperature today?’);

This then brings up a pop up window asking you what the temperature is in Kelvin before calculating it to fahrenheit.

Hope that helps :grinning:


#4