Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Prompting the user to enter today's Kelvin temperature
- const kelvin = prompt('What is the Kelvin temperature today?');
- // Celsius is 273 degrees less than Kelvin
- const celsius = kelvin - 273;
- // Calculating Fahrenheit temperature to the nearest integer
- let fahrenheit = Math.floor(celsius * (9/5) + 32);
- // Displaying the temperature using string interpolation
- console.log(`The temperature is ${fahrenheit} degrees fahrenheit.`)
Add Comment
Please, Sign In to add comment