|
The first review
It is time to review all of the things we have gone over. That means I create a program and explain what it does.
See! Using variables is not that hard! And we found out that if you put a floating point number into an integer, the integer truncates everything after the period. We also found out about what is in a variable before you give it a value, garbage. And if you accidentally use the variable with no value, also known as an un-initialized variable, you get a compiler warning. Another point that needs to be touched on is the difference between data types. If you put the value of a double or float into an integer, and that double or float has a decimal fraction, the fraction is truncated. And if you put a double into a float, and that double is larger than 3.4 * 10^381, the value is "wrapped" into a negative number. Why? The reason has to do with the binary number systems computers use and is a little complicated. Well, the review is over. Unless I get some mail, asking for more explanation....
|