Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // todays forecast, value to stay constant
  2. const kelvin = 293;
  3.  
  4. // this converts Kelvin to Celsius by sub 273
  5. const celsius = kelvin - 273;
  6.  
  7. // converts Celsius to Fahrenheit
  8. let fahrenheit = celsius * (9/5) + 32;
  9. // converts Celsius to Newton while also rounding down
  10. let newton = Math.floor(celsius * (33/100));
  11.  
  12. // rounds down fahrenheit to a whole number
  13. fahrenheit = Math.floor(fahrenheit);
  14. // prints the temperature in Fahrenheit
  15. console.log(`The temperature is ${fahrenheit} degrees Fahrenheit.`);
  16. // prints the temperature in Newton
  17. console.log(`The temperature is ${newton} degrees Newton.`);
  18.  
  19. // end code //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement