CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 4

4. Write a program which accept temperature in Fahrenheit and print it in centigrade.

Admittedly, I was caught like a deer in headlights for this assignment.  I am no mathematician, nor do I regularly utilize the metric system.  With that said, I was able to quickly find a website with helpful formulas to tackle this issue.

According to RapidTables, I will be able to convert Fahrenheit to centigrade/Celsius by using the following equation(s):

T(°C) = (T(°F) - 32) × 5/9
or
T(°C) = (T(°F) - 32) / (9/5)
or
T(°C) = (T(°F) - 32) / 1.8

Utilizing the third formula, I was able to create a program converting temperatures. For the sake of simplicity, I decided to use the 3rd equation.




To my surprise, it worked flawlessly. 


However, because I am no expert, I checked my conversion using Google's conversion tool.  Based on the provided information, I was able to confirm that my conversion was correct.  Also, it appears that Google's conversion tool uses the 1st formal.  **In order to access the conversion tool, I simply searched for "Fahrenheit to Celsius converter".




Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 9

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8