futurestar22 / temprature-convertor-from-kelvin-to-celsius-fahrenheit-and-newton-in-javascript Goto Github PK
View Code? Open in Web Editor NEW//Today's forcast is 293k const kelvin = 293; //Celsius = K-273 const celsius = kelvin- 273; //Print the output in celsius console.log(`The temprature is ${celsius}°C`) //fahrenheit = Celsius * (9/5) + 32 ; Should be a float let fahrenheit = (celsius * (9/5) + 32) ; //converted fahrenheit to double fahrenheit = Math.floor(fahrenheit); //Print the output in fahrenheit console.log(`The temprature is ${fahrenheit}°F`) //For Newton scale let newton = (celsius * (33/100)); newton = Math.floor(newton); //Print the output in Newton console.log(`The temprature is ${newton}°N.`)