A collection of introductory Fortran exercises …
Lateral surface area and volume of a cylinder
Write a program that will make the following geometrical calculations:
- Prompt the user to enter the diameter of the cylinder in inches.
- Prompt the user to enter the height of the cylinder in inches.
- Calculate the radius of the cylinder in inches.
- Calculate the lateral surface area of the cylinder in square inches.
- Calculate the volume of the cylinder in cubic inches.
- Provide screen output that shows the diameter, height, radius, lateral surface area, and volume of the cylinder.
You will need the following formulae:
Lateral surface area = $2 \pi r h$;
Volume = $\pi r^2 h$,
where $r$ = radius, $h$ = height, and $\pi$ = 3.14159 …