*/
Want to see what people are talking about? See the latest forum posts.
*/

View \PERIMS.PAS

This is the second disk of the PASCAL TUTOR system. It has the

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


(* 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 *)

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.