part1c - WRITE"Enter the items to be purchased and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
PROGRAM part1c IMPLICIT NONE INTEGER::ierror, i=0 CHARACTER(20):: filename, items WRITE(*,*)"What is the name of the file:" READ(*,*)filename OPEN(UNIT= 20,FILE=filename, STATUS='NEW', ACTION='WRITE', IOSTAT = ierror) IF(ierror/=0) STOP WRITE(20,*) 'GROCERY LIST:' WRITE(20,*) '______________'
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: WRITE(*,*)"Enter the items to be purchased, and enter a (.) to stop:" DO i=i+1 READ(*,'(A)') items IF(items=='.') EXIT WRITE(20,'(I2,A,A)')i,'.',items END DO WRITE(*,*)"Your grocery list was stored in the following file:", TRIM(filename) CLOSE(20) END PROGRAM...
View Full Document

This note was uploaded on 07/22/2010 for the course MAE 112 taught by Professor Freeh during the Spring '10 term at North Country Community College.

Ask a homework question - tutors are online