! 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.6. (Catherine Spade, 8 October 1999)
! Count high and low temperatures.
  program A06
    implicit none
    integer, parameter :: LIMIT = 30
    real, parameter :: BOUNDARY = 68.0
    real :: Temperature
    integer :: High_Count, Low_Count, Loop
! start program A06
    High_Count = 0
    Low_Count = 0
    do Loop = 1, LIMIT
      write (unit = *, fmt = *) " Please enter the next temperature. "
      read (unit = *, fmt = *) Temperature
      if (Temperature >= BOUNDARY) then
        High_Count = High_Count + 1
      else
        Low_Count = Low_Count + 1
      end if
    end do
    write (unit = *, fmt = *) High_Count, " hot days, and ", Low_Count, " cold days this month."
    stop
  end program A06
