Guest User

Untitled

a guest
Oct 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // Prompting the user to enter today's Kelvin temperature
  2. const kelvin = prompt('What is the Kelvin temperature today?');
  3.  
  4. // Celsius is 273 degrees less than Kelvin
  5. const celsius = kelvin - 273;
  6.  
  7. // Calculating Fahrenheit temperature to the nearest integer
  8. let fahrenheit = Math.floor(celsius * (9/5) + 32);
  9.  
  10. // Displaying the temperature using string interpolation
  11. console.log(`The temperature is ${fahrenheit} degrees fahrenheit.`)
Add Comment
Please, Sign In to add comment