Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // todays forecast, value to stay constant
- const kelvin = 293;
- // this converts Kelvin to Celsius by sub 273
- const celsius = kelvin - 273;
- // converts Celsius to Fahrenheit
- let fahrenheit = celsius * (9/5) + 32;
- // converts Celsius to Newton while also rounding down
- let newton = Math.floor(celsius * (33/100));
- // rounds down fahrenheit to a whole number
- fahrenheit = Math.floor(fahrenheit);
- // prints the temperature in Fahrenheit
- console.log(`The temperature is ${fahrenheit} degrees Fahrenheit.`);
- // prints the temperature in Newton
- console.log(`The temperature is ${newton} degrees Newton.`);
- // end code //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement