Required Program
header information with sample FORTRAN program
red information is a program specific example and should not be
present in other programs
Programmer:
Course:
Date Due:
Language:
Compiler used:
Source Filename:
Executable Filename (if any) or None:
Professor:
Description of the program's PURPOSE:
To find the area of multiple
trapezoids given the lengths
of the parallel sides and the height of each
Description of program's required INPUT:
Multiple sets
of 3 numbers at a time (on a line).
Numbers represent the lengths of
the 2 parallel sides of a trapezoid and its height. Zeroes will signal end of
data
Description of program's expected OUTPUT:
Labeled information about each
trapezoid: base1,
base2, height, area
Descriptions of any MODIFICATIONS made in debugging the program:
General COMMENTS about the PROGRAM
Numbers are assumed to be
positive
No error checking is performed
This program uses the fixed column format required by early FORTRAN
General COMMENTS explaining the syntax or features of the LANGUAGE
c2345678910
6
READ (5, 10) BOTTOM, TOP, HEIGHT
10 FORMAT (F5.2, F5.2, F5.2)
IF ((BOTTOM .EQ. 0) .AND. (TOP .EQ.
0) .AND. (HEIGHT .EQ. 0))
C
GO TO 39
WRITE (6, 11) ' the top is ', top
11 FORMAT (1X, A15, F10.2)
WRITE (6, 11) ' the bottom is ', bottom
WRITE (6, 11) ' the height is ', height
AREA = .5 *(BOTTOM+TOP) * HEIGHT
WRITE (6, 25) area
25 FORMAT (1X, ' The area of
the trapezoid is ', F10.2)
GO TO 6
39 WRITE (6, 78) 'This program has ended
successfully'
78 FORMAT (1x, A40)
STOP
END