FORTRAN Reference Manual

Program Compilation
FORTRAN Reference Manual528615-001
9-11
Source Listing
Example 9-1. Compiler Listing—Source Listing (page 1 of 2)
1. ? ?ICODE
2. * C Program to set up table of lot number, name, property
3. * C value and determine tax charge.
4. * C
5. * C avalue = average property value
6. * C atax = average tax
7. * C tvalue = sum of property values
8. * C ttax = total tax
9. * C
10. 40 FORMAT ('0',5x, i4, 5x,a11,5x,f6.0,f7.2)
11. 50 FORMAT ('0',5x,'Lot #',4x, 'Owner''s Name',5x,'Value',4x
12. - & 'Tax Charge')
13. * C
14. 100 CHARACTER name*11
15. REAL value, tax, taxch, tvalue, ttax, avalue, atax
16. DATA avalue, atax, ttax, tvalue/4*0/
17. * C
18. 150 WRITE (6,50)
19. * C
20. * C Execute loop to determine taxcharge and to accumulate
21. * C total value and total taxcharge:
22. * C
23. 200 DO 400 j = 1,5
24. 1 READ *, lotnum, name, value
25. 1 tvalue = tvalue + value
26. 1 IF (value .LT. 10000) THEN
27. 2 taxchg = .03 * VALUE
28. 2 ELSE
29. 2 taxchg = .04 * VALUE
30. 2 ENDIF
31. 1 WRITE (6,40) lotnum, name, value, taxchg
32. 1 ttax = ttax + taxchg
33. 1 400 CONTINUE
34. * C
35. 450 atax = ttax/5
36. avalue = tvalue/5
37. * C