0

So I have to write this program in fortran77 wiith .f file extension and I dont want to compile it with an option. I want to fixed the error for but for some reason everythiing I've tried is still giving me this error. Ive included the code and the error terminal outputs

''' program p1 implicit none integer :: choice real :: inputValue

       do while(choice /= 0) 
              print *, ' '
              print *, 'Enter a conversion option (1-6 or 0 to exit):'
              print *, '-------------'
              print *, '(1) Pounds to Kilograms'
              print *, '(2) Kilograms to Pounds'
              print *, '(3) Feet to meters'
              print *, '(4) Meters to feet'
              print *, '(5) farenheit to Celsius'
              print *, '(6) Celsius to Fahrenheit'
              print *, '(0) Exit this progrm'
              print *, '-------------'
              READ(*,*) choice
  
              IF (choice == 1) THEN
                  print *, 'Please enter the number (Integer) of Pounds to be converted into Kilograms'
                  READ(*,*) inputValue
                  inputValue  = inputValue / 2.20
                  print *, 'Your value is:', inputValue
               ELSE IF (choice == 2) THEN
                  print *, 'Please enter the number (Integer) of Kilograms to be converted into Pounds'
                  READ(*,*) inputValue
                  inputValue = inputValue * 2.20
                  print *, 'Your value is:', inputValue
               ELSE IF (choice == 3) THEN
                  print *, 'Please enter the number (Integer) of Feet to be converted into Meters'
                  READ(*,*) inputValue
                  inputValue = inputValue / 3.28
                  print *, 'Your value is:', inputValue
               ELSE IF (choice == 4) THEN
                  print *, 'Please enter the number (Integer) of Meters to be converted into Feet'
                  READ(*,*) inputValue
                  inputValue = inputValue * 3.28
                  print *, 'Your value is:', inputValue
               ELSE IF (choice == 5) THEN
                  print *, 'Please enter the number (Integer) of Fahrenheit to be converted into Celsius'
                  READ(*,*) inputValue
                  inputValue = (5.0/9.0) * (inputValue - 32)
                  print *, 'Your value is:', inputValue
               ELSE IF (choice == 6) THEN
                  print *, 'Please enter the number (Integer) of Celsius to be converted into Fahrenheit'
                  READ(*,*) inputValue
                  inputValue = (inputValue * 9.0/5.0) + 32
                  print *, 'Your value is:', inputValue
               ELSE IF (choice == 0) THEN
                  print *, 'EXIT'
          
               END IF 
      ENDDO  
  
    end program p1'''

Here is the error output image

  • In fixed-form, the continuation character must be placed in column 6. – steve Aug 25 '21 at 02:12
  • Your error output (please don't use images for such text) does not match your code. However, your lines are too long and you need to split strings carefully in fixed-form source. Note the line length limits and column alignment. Aspects covered across each of the linked questions. – francescalus Aug 25 '21 at 05:10
  • Saying that you do not want to use switches is a bit one eyed. The switches -warn truncated, -w123 and -fixed are our friends here. – Holmz Aug 25 '21 at 23:42

0 Answers0