TempConv.ob07 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. (*
  2. adapted to Oberon-07 by 0CodErr, KolibriOS team
  3. *)
  4. (* This program is a good example of proper formatting, it is *)
  5. (* easy to read and very easy to understand. It should be a *)
  6. (* snap to update a program that is well written like this. You *)
  7. (* should begin to develop good formatting practice early in *)
  8. (* your programming career. *)
  9. MODULE TempConv;
  10. IMPORT In, Out, Console;
  11. VAR
  12. Count : INTEGER; (* a variable used for counting *)
  13. Centigrade : INTEGER; (* the temperature in centigrade *)
  14. Farenheit : INTEGER; (* the temperature in farenheit *)
  15. BEGIN
  16. Console.open;
  17. Out.String("Farenheit to Centigrade temperature table");
  18. Out.Ln;
  19. Out.Ln;
  20. FOR Count := -2 TO 12 DO
  21. Centigrade := 10 * Count;
  22. Farenheit := 32 + Centigrade * 9 DIV 5;
  23. Out.String(" C =");
  24. Out.Int(Centigrade, 5);
  25. Out.String(" F =");
  26. Out.Int(Farenheit, 5);
  27. IF Centigrade = 0 THEN
  28. Out.String(" Freezing point of water");
  29. END;
  30. IF Centigrade = 100 THEN
  31. Out.String(" Boiling point of water");
  32. END;
  33. Out.Ln;
  34. END; (* of main loop *)
  35. In.Ln;
  36. Console.exit(TRUE)
  37. END TempConv.