#WSQ05 – Temperature

For this assignment we had to ask the user first for the temperature in fahrenheit and convert it to celsius.

So first of all I had to ask the user for the temperature and store it into a variable.

Screen Shot 2016-02-20 at 3.39.18 PM

Next convert that number into what would be the temperature in celsius.

So I used the formula to convert from fahrenheit to celsius and passed in the ‘temp’ variable which holds the temperature in fahrenheit. Then converted the result into a float type number and stored it all into a new variable called ‘celsius’

Screen Shot 2016-02-20 at 3.46.28 PM

After that I output a message where it informs the user the temperature he wanted to convert and the converted temperature in celsius.

Screen Shot 2016-02-20 at 3.49.32 PM

As something extra a put an if statement that if the converted temperature is less than 100 (The temperature in which water boils in celsius) it prints out a message that says ‘Water does not boil at this temperature’ and if it greater it prints out a message saying ‘Water does boil at this temperature’

Screen Shot 2016-02-20 at 3.51.57 PM

This is what the final program does:

Screen Shot 2016-02-20 at 3.52.55 PM

CC BY-SA 4.0 #WSQ05 – Temperature by kevingmcc is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.