-
-
Save codecademydev/968562f9d8678e1c00908862d6e0daa5 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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