Isaac
Arp 142 - The Penguin and the Egg
The Fortran Laboratory
God himself was too kind to remain idle, and began to play the game of signatures, signing his likeness into the world; therefore I chance to think that all nature and the graceful sky are symbolized in the art of geometry.Johannes Kepler, commenting on the Platonic solids in his manuscript Mysterium Cosmographicum

A collection of introductory Fortran exercises …

Contents

  1. Lateral surface area and volume of a cylinder

Some Exercises in Fortran

Lateral surface area and volume of a cylinder

Elijah

Write a program that will make the following geometrical calculations:

  1. Prompt the user to enter the diameter of the cylinder in inches.
  2. Prompt the user to enter the height of the cylinder in inches.
  3. Calculate the radius of the cylinder in inches.
  4. Calculate the lateral surface area of the cylinder in square inches.
  5. Calculate the volume of the cylinder in cubic inches.
  6. 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 …

back-to-top DANGER