Jump to content


Check out our Community Blogs

sobi

Member Since 30 Apr 2009
Offline Last Active May 05 2009 04:36 AM
-----

Posts I've Made

In Topic: Procedures

04 May 2009 - 03:04 PM

Ok, not exactly sure on what to do again on this. Inserted the Begin/End pair in the main body of the program to call the functions. I'm now having an error. This is what i have:
(* This Program calculates and prints the diameter, the circumference,
or the area of a circle, given the radius *)

PROGRAM Computes (Volume, Surface_Area);
CONST
    Pi = 3.142;
VAR
   Radius, Length, Voloume_of_cylinder, Surface_area_of_cylinder:
           Real;

PROCEDURE Compute_Volume_of_Cylinder (VAR Radius, Pi, Length, Volume_of_Cylinder:
          Real);

          BEGIN
          Writeln('Enter the radius of the cylinder.');
          Readln(Radius);
          Writeln('Enter the length of the cylinder.');
          Readln(Length);
          Volume_of_cylinder := Pi * Radius * Radius * Length;
          Writeln('Volume_of_Cylinder: ', Volume_of_Cylinder);
          Readln();
          END;
PROCEDURE Compute_Surface_Area (VAR Radius, Surface_area_of_cylinder, Length:
          Real);
          BEGIN
          Writeln('Enter the radius of the cylinder.');
          Readln(Radius);
          Writeln('Enter the length of the cylinder.');
          Readln(Length);
          Surface_area_of_cylinder := 2 * Pi * Radius *( Length + Radius);
          Writeln('Surface_area_of_cylinder: ', Surface_area_of_cylinder);
          Readln();
          END;


begin
     Computes ;
     Compute_Volume_of_Cylinder ;
     Compute_Surface_Area ;

end.

In Topic: Procedures

04 May 2009 - 08:38 AM

Not quite sure about calling the functions, can you put me through on this?

In Topic: Procedures

03 May 2009 - 04:13 PM

It is not giving me the value of the volume and surface area as is intended by the program. I am not even seeing any of the writelns in the procedure displayed when i run the program.The only writeln i am seeing is the one outside the procedures. i must be missing something.

In Topic: Procedures

03 May 2009 - 03:28 PM

The questions is: Write an interactive pascal program to
calculate the volume and surface area of a cylinder, given the radius and the length. One procedure is to be used to calculate the volume and another procedure to calculate the length.
Formula for calculating volume: πr^2L(ie Pi *R*R*L) and surface area: 2#R(L+R)
ie : 2*Pi*R(L+R).

In Topic: Pascal program that inputs an integer larger than 1

01 May 2009 - 03:49 PM

Thanks all,finally it worked.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download