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.
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’
After that I output a message where it informs the user the temperature he wanted to convert and the converted temperature in celsius.
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’
This is what the final program does:
#WSQ05 – Temperature by kevingmcc is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.