Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

assignment should be modifieds program to read a file input of 255 characters or

ID: 3764457 • Letter: A

Question

assignment should be modifieds program to read a file input of 255 characters or less till the program runs. do not need to make another file to make this program work. Just make a blank one with a name for the program to grab and put into the program

exception: file name entered blank, then input might be from standard which is default input as it does .

program to read a file input of 255 characters untill the program runs

This is my assignment, not sure what my professor really is asking for,

but sure that this is not working when I attempt to excute.

Your assignment is to add optional file input and output functionality to the utility program ExtractDesign.

The functionality must remain the same with the exception that input or output may be optionally redirected to files and your program shall conform to the Homework Submission Requirements.

The program shall attempt to read an input file name until the file opens successfully.

(Microsoft states that the maximum length of Windows file names is 255 characters.)

An exception is that if the file name entered is blank, then input shall be from standard (default) input as it does now.

The program shall attempt to read an output file name until the file opens successfully.

An exception is that if the file name entered is blank, then output shall be to standard (default) output as it does now.

It is fortran.

Explanation / Answer

program inputoutputdata

implicit none

                real, dimension(50) :: a,b

                real, dimension(50) :: c,d

                integer :: j

                ! open the file stream for reading the data

                open(2, file1=’E:/Files/file1.txt’, status=’old’)

                ! data part of the code

                do j=1,50

                                read(2,*) c(j), d(j)

                end do

                close(2)

end program inputoutputdata