Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Constant temperature
- const kelvin = 293;
- // T(K) = T(C) + 273
- let celsius = kelvin - 273;
- // T(F) = (9/5) * T(C) + 32
- let fahrenheit = 1.8 * celsius + 32;
- // Round "donw" the Fahrenheit temperature
- fahrenheit = Math.floor(fahrenheit);
- // Display
- console.log("Kelvin: " + kelvin);
- console.log("Celsius: " + celsius);
- console.log(`Fahrenheit: ${fahrenheit} `);
- // Newton Scale for temperature
- let newton = 0.33 * celsius;
- newton = Math.floor(newton);
- console.log("Newton: " + newton);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement