We are going to see how well we’ve understood the “if” and “else” conditionals, you know, those pesky words from fifth grade Grammar:
First up we have the code. Notice that there is a void type function before the main function. This was used by me in order to see if I knew how to correctly use those, and it turned out well, but the code can do without a void type function, having the “if” and “else” conditionals inside the main funciton.
As usual, we compile in Cygwin to check for any mistakes and happily find out there are none, giving the program the value 289 as Fahrenheit temperature.
It does work! We get the conversion from Fahrenheit to Celsius and a message indicating that water reaches its boiling point at this temperature. Then we try with a lower value and get a message informing us that this is too low for water to become a gas.
]]>Just kidding, this is a redirect page for the fourth WSQ, the “About” page. Since I can’t put tags in the about page, you’ll just see everything from here. Hope it’s not too confusing!
]]>We are going to see how well we’ve understood the “if” and “else” conditionals, you know, those pesky words from fifth grade Grammar:
First up we have the code. Notice that there is a void type function before the main function. This was used by me in order to see if I knew how to correctly use those, and it turned out well, but the code can do without a void type function, having the “if” and “else” conditionals inside the main funciton.
As usual, we compile in Cygwin to check for any mistakes and happily find out there are none, giving the program the value 289 as Fahrenheit temperature.
It does work! We get the conversion from Fahrenheit to Celsius and a message indicating that water reaches its boiling point at this temperature. Then we try with a lower value and get a message informing us that this is too low for water to become a gas.
]]>This is the preamble for functions, so it is a very important task to know what we’re doing here for future works. The code is shown here below, where we defining the variables before the main function, while making the calculations in the main function.
Then we compile it on Cygwin to check for any mistakes… since it doesn’t have any, we give the program the values 13 and 5, just for fun.
And run it to see how well it does its job!
]]>