*****************************
* Your Name *
*****************************
OPEN(UNIT=21,FILE='SYS$OUTPUT',STATUS='UNKNOWN')
OPEN(UNIT=22,FILE='CIRCLE.DAT',STATUS='UNKNOWN')
WRITE(UNIT=21,FMT=2500)
2500 FORMAT(1X,'CIRCLES AND SPHERES')
WRITE(UNIT=21,FMT=3000)
3000 FORMAT(1X,'IF RADIUS IS',3X,'WITH DENSITY',2X,
1'CIRCUMFERENCE',9X,'VOLUME',9X,'WEIGHT'/)
100 READ(UNIT=22,FMT=1000)RAD,DENS
IF(RAD.EQ.0)GOTO 9900
1000 FORMAT(F6.2,1X,F6.2)
CIRC=RAD*2.0*3.1416
VOL=(RAD**3*3.1416*4)/3.0
WT=VOL*DENS
WRITE(UNIT=21,FMT=2000)RAD,DENS,CIRC,VOL,WT
2000 FORMAT(1X,6(F12.2,3X))
GOTO 100
9900 WRITE(UNIT=21,FMT=4000)
4000 FORMAT(/,1X,'END OF DATA')
STOP
END
000100 000100 000010 000500 000250 000050 000500 000001 001000 000050 001234 004321 010000 001000 000000 000000
If you get errors refer to file above and correct them with the editor. If you have trouble, you will want to print the .LIS file. (The turn in for this lab is a printout of this .LIS file.)$ fortran circle /list
$ link circle $ run circle
$ delete circle.obj;*, circle.exe;* $ purge circle.*
Place the lab in the instructor hand-in box in BUS R6E, the "terminal room".Your-Name Lab 4.6: FORTRAN circle program TABER CSC135