home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pascal / pascsrc.arc / PERIMS.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  1KB  |  43 lines

  1.                                        (* Chapter 13 - Program 2 *)
  2. unit Perims;
  3. (*****************************************************************)
  4. (*                                                               *)
  5. (* This unit contains three procedures to calculate perimieters  *)
  6. (* of three geometric shapes.                                    *)
  7. (*                                                               *)
  8. (*****************************************************************)
  9.  
  10. interface
  11.    procedure Perimeter_Of_Circle(Radius : real;
  12.                                  var Perimeter : real );
  13.    procedure Perimeter_Of_Square(Length_Of_Side : real;
  14.                                  var Perimeter : real);
  15.    procedure Perimeter_Of_Rectangle(Length,Width : real;
  16.                                     var Perimeter : real);
  17.  
  18. implementation
  19.  
  20. var My_Pi : real;
  21.  
  22.  
  23. procedure Perimeter_Of_Circle;
  24. begin
  25.    Perimeter := My_Pi * 2.0 * Radius;
  26. end;
  27.  
  28.  
  29. procedure Perimeter_Of_Square;
  30. begin
  31.    Perimeter := 4.0 * Length_Of_Side;
  32. end;
  33.  
  34.  
  35. procedure Perimeter_Of_Rectangle;
  36. begin
  37.    Perimeter := 2.0 * (Length + Width);
  38. end;
  39.  
  40.  
  41. begin                   (* This is the initialization code *)
  42.    My_Pi := 3.14159267;
  43. end.  (* of unit Perimeters *)