Skip to content

Instantly share code, notes, and snippets.

@magi196502
Forked from codecademydev/app.js
Created November 8, 2018 19:37
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 magi196502/54e61edada7ae3fa47f1c51a26fcef40 to your computer and use it in GitHub Desktop.
Save magi196502/54e61edada7ae3fa47f1c51a26fcef40 to your computer and use it in GitHub Desktop.
Codecademy export
// Define the initial value of kelvin and
// set to 293 degrees kelvin
const kelvin = 293;
// convert degrees kelvin to degrees celcius by subtracting 273
const celsius = kelvin - 273;
// Convert to degrees fahrenheit and round down
let fahrenheit = Math.floor(celsius * (9/5) + 32);
console.log(`The temperature ${kelvin} is ${fahrenheit} degrees Fahrenheit.`);
// Convert degrees celsius to degrees newton
let newton = Math.floor(celsius * (33/100));
console.log(`The temperature ${celsius} is ${newton} degrees newton.`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment