Quiz: Converting Temperatures (2-2)
To convert Celsius to Fahrenheit, you can use the following formula:
華氏溫度與攝氏溫度的轉換計算。
F=C×1.8+32
Use this equation and the variables fahrenheit and celsius to print the Fahrenheit equivalent of 12°C.
NOTE: "12°C" reads as "12 degrees Celsius".
Your Code:
/*
* Programming Quiz: Converting Tempatures (2-2)
*
* Use the Celsius-to-Fahrenheit formula to set the fahrenheit varible:
*
* F = C x 1.8 + 32
*
* Log the fahrenheit variable to the console.
*
*/
var celsius = 12;
var fahrenheit = celsius * 1.8 +32 /* convert celsius to fahrenheit here */
console.log(fahrenheit);