Skip to content

Instantly share code, notes, and snippets.


codecademydev/app.js Secret

Created Jan 6, 2021
What would you like to do?
Codecademy export
// today's temperature is 293 kelvin
const kelvin = 2930;
// Celsius is 273 less than Kelvin
const celsius = kelvin - 273;
console.log(`Today's Temp in Kelvin: ${kelvin} degrees and in Celsius: ${celsius} degrees`);
// Fahrenheit = celsius *(9/5) +32
let fahrenheit = celsius *(9/5)+32
console.log(`In Fahrenheit that is ${fahrenheit}`)
fahrenheit = Math.floor(fahrenheit);
// Next line rounds the Fahrenheit number down to the nearest whole number
console.log(`The temperature is ${fahrenheit} degrees Fahrenheit`);
console.log(`${kelvin} Kelvin is about ${fahrenheit} degrees Fahrenheit.`)
const newton = celsius *(33/100)
// This Temperature expressed in Newtons
console.log(`In Newtons this would be ${newton}`)
newton = Math.floor(newton);
console.log(`This is the rounded temperature in Newtons: ${newton}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment