home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / programm / prog2 / dumbconv.ada < prev    next >
Encoding:
Text File  |  1991-07-01  |  1.1 KB  |  55 lines

  1.                                        -- Chapter 5 - Program 7
  2. with Text_IO;
  3. use Text_IO;
  4.  
  5. procedure DumbConv is
  6.  
  7.    package Int_IO is new Text_IO.Integer_IO(INTEGER);
  8.    use Int_IO;
  9.  
  10.    X, Y : INTEGER;
  11.  
  12. begin
  13.    Put("Centigrade to Farenheight temperature table");
  14.    New_Line(2);
  15.    for Count in INTEGER range -2..12 loop
  16.       X := 10 * Count;
  17.       Y := 32 + X * 9 / 5;
  18.       Put("C =");
  19.       Put(X,5);
  20.       Put("    F =");
  21.       Put(Y,5);
  22.       if X = 0 then
  23.          Put("  Freezing point of water");
  24.       end if;
  25.       if X = 100 then
  26.          Put("  Boiling point of water");
  27.       end if;
  28.       New_Line;
  29.    end loop;
  30. end;
  31.  
  32.  
  33.  
  34.  
  35. -- Result of execution
  36.  
  37. -- Centigrade to Farenheit temperature table
  38. --
  39. -- C =  -20    F =   -4
  40. -- C =  -10    F =   14
  41. -- C =    0    F =   32  Freezing point of water
  42. -- C =   10    F =   50
  43. -- C =   20    F =   68
  44. -- C =   30    F =   86
  45. -- C =   40    F =  104
  46. -- C =   50    F =  122
  47. -- C =   60    F =  140
  48. -- C =   70    F =  158
  49. -- C =   80    F =  176
  50. -- C =   90    F =  194
  51. -- C =  100    F =  212  Boiling point fo water
  52. -- C =  110    F =  230
  53. -- C =  120    F =  248
  54.  
  55.