Here’s my code for the Kelvin Weather project:
I cannot get my code to run properly on this assignment. I went back and changed my code to be character for character exactly what is suggested in the hints. It still does not run. Is this an error on codecademy’s side possibly?
Hello, I’m trying to solve this project. I did all the steps in the lesson and tried also changing the kelvin degrees to 0 but not working. Don’t know what’s going on.
When I click on save i’m just getting this all the time : The temperature is ${fahrenheit} degrees Fahrenheit.
no actual conversion of degrees / results.
Thank you for any help.
//kelvin temperature
const kelvin = 293;
//kelvin to celsius
const celsius = kelvin - 273;
//fahrenheit to celsius conversion
let fahrenheit = celsius * (9/5) + 32;
//fahrenheit round down
fahrenheit = Math.floor(fahrenheit);
console.log(‘The temperature is ${fahrenheit} degrees Fahrenheit.’);
Check your console.log. You put your string within quotes rather than a back tick ( ` ). Fixing that should fix your issue.
I hope this helps!
That fixed it. Thanks for taking the time to help.
Awesome! It’s no problem at all!
I’ve tried everything and redone everything, the code works it just won’t let me continue with the rest of the lesson, I even copied the entire video on the"Get Unstuck" button.
Here’s my code:
//Current Temperature in Kelvin Degrees.
const Kelvin = 0;
//Converting Kelvin to Celsius.
const Celsius = Kelvin - 273;
//Convert Celsius to Fahrenheit.
let Fahrenheit = Celsius * (9/5) + 32;
//Round down Fahrenheit Variable
Fahrenheit = Math.floor(Fahrenheit);
console.log(The temperature is ${Fahrenheit} degrees Fahrenheit.
);
let Newton = Celsius * (33/100);
Newton = Math.floor(Newton);
console.log(The temperature is ${Newton} degrees Newton.
);
I had the variable names as all lowercase in mine …
like fahrenheit
instead of Fahrenheit
I don’t know if the periods at the end of the strings should or should not be there.
When i click on save code, on the left instruction bar the checkbox won’t change it stays empty is preventing from being able to continue with the project.
i tried changing browser edge and chrome and updating browser but to no avail.
I need help i cant continue!
click on the checkboxes on the left (in the instructions) for the projects.
There is a problem, I cannot continue the course after successfully completing this project, here is my code and the result of my code below:
// Current day temperature forecast in kelvin units.
const kelvin = 0;
// Celsius variable.
const celsius = kelvin - 273;
//Fahnrenheit value
let fahrenheit = celsius * (9 / 5) + 32;
// Round the result of Celsius to Fahnrenheit conversion.
fahrenheit = Math.floor(fahrenheit);
const temperature = fahrenheit;
//Log temperature to the console.
console.log(The temperature is ${temperature} degrees Fahrenheit!
);
//Convert celsius to newton.
let newton = celsius * (33 / 100);
newton = Math.floor(newton);
//Log Newton to the console.
console.log(The temperature is ${newton} degrees Newton.
);
Output:
The temperature is -460 degrees Fahrenheit!
The temperature is -91 degrees Newton.
The continue button remains gray stopping me from continuing, it seems an expected result was not met, but this time I cannot spot the issue, any help.?
I fgured out the problem, all the checkboxes were not ticked in my case.
hey guys, is there anything wrong with my code, its not working and it always says “type error”
// Current temperature in kelvin degrees.
const kelvin = 293;
// Converting kelvin to celsius.
const celsius = kelvin - 275;
// Convert celsius to fahrenheit
const fahrenheit = celsius * (9 / 5) + 32;
// Round down fahrenheit variable.
fahrenheit = Math.floor(fahrenheit);
console.log(The temperature is ${fahrenheit} degrees Fahrenheit.
);
plus this is what the error said:
/home/ccuser/workspace/learn-javascript-intro-kelvin-weather/app.js:11
fahrenheit = Math.floor(fahrenheit)
^
TypeError: Assignment to constant variable.
at Object. (/home/ccuser/workspace/learn-javascript-intro-kelvin-weather/app.js:11:12)
at Module._compile (module.js:571:32)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
You may want to read back through your notes about constant variables. This error message states exactly what you are doing that is not allowed.
ok, thank you so much