Formula for calculating volume: πr^2L(ie Pi *R*R*L) and surface area: 2#R(L+R)
ie : 2*Pi*R(L+R).
Here is my code so far, not getting exactly what i want.
PROGRAM Compute_Volume (Output);
CONST
Pi = 3.142;
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
Writeln('This must work');
Readln();
Writeln('Compute volume of cylinder');
Readln();
END.


Sign In
Create Account

Back to top









