home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
pascal
/
pascsrc.arc
/
PERIMS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
1KB
|
43 lines
(* Chapter 13 - Program 2 *)
unit Perims;
(*****************************************************************)
(* *)
(* This unit contains three procedures to calculate perimieters *)
(* of three geometric shapes. *)
(* *)
(*****************************************************************)
interface
procedure Perimeter_Of_Circle(Radius : real;
var Perimeter : real );
procedure Perimeter_Of_Square(Length_Of_Side : real;
var Perimeter : real);
procedure Perimeter_Of_Rectangle(Length,Width : real;
var Perimeter : real);
implementation
var My_Pi : real;
procedure Perimeter_Of_Circle;
begin
Perimeter := My_Pi * 2.0 * Radius;
end;
procedure Perimeter_Of_Square;
begin
Perimeter := 4.0 * Length_Of_Side;
end;
procedure Perimeter_Of_Rectangle;
begin
Perimeter := 2.0 * (Length + Width);
end;
begin (* This is the initialization code *)
My_Pi := 3.14159267;
end. (* of unit Perimeters *)