*/
Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?
*/

View \GARDEN.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 13 - Program 3 *)
program Garden;
(*****************************************************************)
(*                                                               *)
(* This program calculates how much area there is to plow in a   *)
(* circular garden, and how long the wall will be around it.     *)
(*                                                               *)
(*****************************************************************)

uses Areas, Perims;

var Radius, Area, Circumference : real;

begin
   Radius := 12.0;
   Area := Area_Of_Circle(Radius);
   Perimeter_Of_Circle(Radius,Circumference);

              (* Calculations complete, output results *)

   Writeln('The radius of the garden is ',Radius:6:1,' feet.');
   Writeln('The area to plow is ',Area:6:1,' square feet.');
   Writeln('A wall around the garden will be ',Circumference:6:1,
                  ' feet long.');
   Writeln;
end.

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.