Monday, 2 August 2010

Temperature conversion - tests

Once a program has been written, it is a good idea to try it out. You can run the program directly by keying [Prog] [1] (if your program was stored in the first program area). For the conversion between Farenheit and Celsius (or vice versa), you can try the following:-

A=1, B=212, then 100 (Celsius) is displayed
A=1, B=32, then 0 (Celsius) is displayed
A=1, B=86, then 30 (Celsius) is displayed

A=2, B=100, then 212 (Farenheit) is displayed
A=2, B=0, then 32 (Farenheit) is displayed
A=2, B=30, then 86 (Farenheit) is displayed

If you get Syntax ERROR, then there is a "bug" (an error) in your program. Using the <> cursor key, the calculator will return to edit mode and show a flashing cursor after the point where the error occurred. This will give you an indication of where things went wrong. It may be obvious what the problem is but sometimes it may require quite a bit of investigation of the logic of your program. In the case of the temperature conversion program it may be because it has been keyed in incorrectly. Note that this program should be 40 steps in length. If you have more or less than this then this may indicate that it hasn't been keyed in right.