Applying Object-Oriented Concepts
to Traditional Languages

Functionally-Designed Fortran Program

This is a functionally-written Fortran program for the sample task of reading two scalars, combining them into a vector, and printing the vector.

   C---------------------------------------------
   C
   C     Read two scalar components of a vector
   C     and print vector
   C
   C               Read first scalar component
         READ (5,100) A
   C               Read second scalar component
         READ (5,100) B
     100 FORMAT (F7.3)
   C               Write vector
         WRITE (6,200) A,B
     200 FORMAT (1X,F7.3,'i +',F7.3,'j')
         END
   C
   C---------------------------------------------
 


[home]
[OO] [Java] [memorial ships]
[humor] [income tax repeal]


Copyright (C) 1998 LDJ Trust