Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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.  
  10. MODULE TempConv;
  11.  
  12. IMPORT In, Out, Console;
  13.  
  14.  
  15. VAR
  16.     Count      : INTEGER;   (* a variable used for counting     *)
  17.     Centigrade : INTEGER;   (* the temperature in centigrade    *)
  18.     Farenheit  : INTEGER;   (* the temperature in farenheit     *)
  19.  
  20. BEGIN
  21.     Console.open;
  22.  
  23.     Out.String("Farenheit to Centigrade temperature table");
  24.     Out.Ln;
  25.     Out.Ln;
  26.     FOR Count := -2 TO 12 DO
  27.         Centigrade := 10 * Count;
  28.         Farenheit := 32 + Centigrade * 9 DIV 5;
  29.         Out.String("   C =");
  30.         Out.Int(Centigrade, 5);
  31.         Out.String("     F =");
  32.         Out.Int(Farenheit, 5);
  33.         IF Centigrade = 0 THEN
  34.             Out.String("   Freezing point of water");
  35.         END;
  36.         IF Centigrade = 100 THEN
  37.             Out.String("   Boiling point of water");
  38.         END;
  39.         Out.Ln;
  40.     END; (* of main loop *)
  41.     In.Ln;
  42.  
  43.     Console.exit(TRUE)
  44. END TempConv.