Skip to content

Instantly share code, notes, and snippets.

@magi196502 magi196502/app.js forked from codecademydev/app.js
Created Nov 8, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.