! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Example P.4. Prompting for terminal keyboard input.
  program A04
    implicit none
    real :: X, Y, Average, Diameter, Fahr, Cels
    real, parameter :: T_SCALE = 1.8, OFFSET = 32.0
! start program A04
    write (unit = *, fmt = *) " Please enter two numbers to be averaged. "
    read (unit = *, fmt = *) X, Y
    Average = (X + Y) / 2.0
    write (unit = *, fmt = *) " The average of ", X, " and ", Y, " is: ", Average
    write (unit = *, fmt = *) " Please enter the diameter of a circle. "
    read (unit = *, fmt = *) Diameter
    write (unit = *, fmt = *) " Circumference: ", atan2( 0.0, -1.0 ) * Diameter
    write (unit = *, fmt = *) " Please enter the Fahrenheit temperature. "
    read (unit = *, fmt = *) Fahr
    Cels = (Fahr - OFFSET) / T_SCALE
    write (unit = *, fmt = *) Fahr, " deg. F = ", Cels, " deg. C "
    stop
  end program A04

