Classic Computer Magazine Archive ANTIC VOL. 6, NO. 4 / AUGUST 1987

Education

Temperature Converter

Finding familiar Fahrenheit from cryptic Celsius and Kelvin

by David Zubak

Do you need your overcoat? It's 26 degrees Celsius outside. Seems as if different temperature measurement systems are really proliferating these days. But with the help of Temperature Converter, your Atari will swiftly translate betweeen Celsius, Kelvin and the familiar Fahrenheit measurements. This BASIC program works on all 8-bit Atari computers of any memory size, with disk or cassette.

You have just passed your neighborhood bank and entered the Temperature Zone.

Everything was fine until you glanced at the bank's digital time and temperature display. The clock was correct as usual, but the temperature could not have been right. On this typically warm, sunny spring day, the temperature was shown as 26, followed by a C.

A reasonable guess would be that C stands for Cold. But actually it stands for Celsius or Centigrade, a temperature scale based on the freezing and boiling points of water. Water freezes at 0 degrees Celsius and boils at 100 degrees Celsius.

Most of us are used to the Fahrenheit temperature scale, where water freezes at 32 degrees and boils at 212 degrees. We're most comfortable at temperatures between 70 and 80 degrees. But what temperature would be comfortable in Celsius?

Still another temperature scale is used in chemistry and other sciences. The Kelvin temperature is based on matter and its properties—0 degrees Kelvin is absolute zero, the temperature at which a pure gas will exert no pressure. Absolute zero equals -459.67 degrees Fahrenheit, -273.15 degrees Celsius.

Temperature Converter takes away the tedium and monotony of remembering these formulas. You won't have to touch a calculator, either. All you need to do is choose which conversion between Fahrenheit, Celsius and Kelvin you'd like and then enter the temperature to be converted. The rest is done at Atari warp speed. Type in Listing 1, TEMPCONV.BAS, check it with TYPO II and SAVE a copy before you RUN it.

Lines 10-40 set the screen and border color, open the keyboard for input and display the main menu. Lines 46-65 disable [BREAK], get your menu choice and send you to the appropriate conversion. Lines 100-650 contain the actual conversion formulas.

David Zubak is a biology major at Broward Community College in Pompano Beach, Florida. Temperature Converter is his first publication in Antic and he wrote it after getting fouled up between different temperature measurements during a chemistry test.

Listing 1  TEMPCONV.BAS Download