Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created January 6, 2021 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/968562f9d8678e1c00908862d6e0daa5 to your computer and use it in GitHub Desktop.
Save codecademydev/968562f9d8678e1c00908862d6e0daa5 to your computer and use it in GitHub Desktop.
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(fahrenheit)
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