October 2017
Beginner
318 pages
7h 26m
English
Now let's try to understand the Fahrenheit case. Consider the following code:
inputValue = ((inputValue-32.0f)*5.0f)/9.0f;
The preceding line of code is a little better than our Kelvin case simply because it contains fewer numbers, but it's still not programmer-friendly by any sense of the word. So what if in our initial implementation of this program, we could provide communication that would really look a lot nicer to a programmer? What if instead of printing out the equation right there, we put the equation somewhere else in our program and call a Fahrenheit to Celsius function?
inputValue = fToC(inputValue);
We'll just type in fToC now to keep things short. This makes a lot more sense to someone looking at our program. ...
Read now
Unlock full access