home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASSRC.ZIP / TEMPCONV.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-04  |  2KB  |  54 lines

  1.                                 (* Chapter 4 - Program 4 *)
  2. (**************************************************************)
  3. (*       Centigrade to Farenheight temperature conversion     *)
  4. (*                                                            *)
  5. (*  This program generates a list of temperature conversions  *)
  6. (*  with a note at the freezing point of water, and another   *)
  7. (*  note at the boiling point of water.                       *)
  8. (**************************************************************)
  9.  
  10. program Temperature_Conversion;
  11.  
  12. var Count,Centigrade,Farenheight : integer;
  13.  
  14. begin
  15.    Writeln('Centigrade to farenheight temperature table');
  16.    Writeln;
  17.    for Count := -2 to 12 do begin
  18.       Centigrade := 10*Count;
  19.       Farenheight := 32 + Centigrade*9 div 5;
  20.       Write('  C =',Centigrade:5);
  21.       Write('    F =',Farenheight:5);
  22.       if Centigrade = 0 then
  23.          Write('  Freezing point of water');
  24.       if Centigrade = 100 then
  25.          Write('  Boiling point of water');
  26.       Writeln;
  27.    end;
  28. end.
  29.  
  30.  
  31.  
  32.  
  33. { Result of execution
  34.  
  35. Centigrade to farenheight temperature table
  36.  
  37.   C =   -20    F =   -4
  38.   C =   -10    F =   14
  39.   C =     0    F =   32  Freezing point of water
  40.   C =    10    F =   50
  41.   C =    20    F =   68
  42.   C =    30    F =   86
  43.   C =    40    F =  104
  44.   C =    50    F =  122
  45.   C =    60    F =  140
  46.   C =    70    F =  158
  47.   C =    80    F =  176
  48.   C =    90    F =  194
  49.   C =   100    F =  212  Boiling point of water
  50.   C =   110    F =  230
  51.   C =   120    F =  248
  52.  
  53. }
  54.