| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- (*
- adapted to Oberon-07 by 0CodErr, KolibriOS team
- *)
- (* This program is a good example of proper formatting, it is *)
- (* easy to read and very easy to understand. It should be a *)
- (* snap to update a program that is well written like this. You *)
- (* should begin to develop good formatting practice early in *)
- (* your programming career. *)
- MODULE TempConv;
- IMPORT In, Out, Console;
- VAR
- Count : INTEGER; (* a variable used for counting *)
- Centigrade : INTEGER; (* the temperature in centigrade *)
- Farenheit : INTEGER; (* the temperature in farenheit *)
- BEGIN
- Console.open;
- Out.String("Farenheit to Centigrade temperature table");
- Out.Ln;
- Out.Ln;
- FOR Count := -2 TO 12 DO
- Centigrade := 10 * Count;
- Farenheit := 32 + Centigrade * 9 DIV 5;
- Out.String(" C =");
- Out.Int(Centigrade, 5);
- Out.String(" F =");
- Out.Int(Farenheit, 5);
- IF Centigrade = 0 THEN
- Out.String(" Freezing point of water");
- END;
- IF Centigrade = 100 THEN
- Out.String(" Boiling point of water");
- END;
- Out.Ln;
- END; (* of main loop *)
- In.Ln;
- Console.exit(TRUE)
- END TempConv.
|