Introduction to Programming with Fortran ---------------------------------------- Practical Exercise 1 (Compilation and Editing) ---------------------------------------------- Question 1 ---------- The following program reads in a number and prints its inverse: PROGRAM INVERT IMPLICIT NONE REAL :: Value, Inverse PRINT *, "Type in a value to invert" READ *, Value Inverse = 1.0/Value PRINT *, "Value", Value, " Inverse", Inverse END PROGRAM INVERT 1.1 Using an editor, type the above program into a file called something like `invert.f90'. 1.2 Compile and run the program. Verify the correctness of the code by supplying the following test data (each value needs a separate run): 1.0 3.0 -20.0 1000.0 1.0e-30 Save a copy of this program in another file (say `invert.safe'). 1.3 See what happens when you supply the following data (each value needs a separate run): 0.0 1.0e-38 1.0e-40 weeble 1.4 Edit the file, change the occurrence of `Value' to `Vole' in the `READ' statement, and see what happens when you compile it. 1.5 Restore the file from the safe copy, change the `READ' to `RODE', and see what happens when you compile it. 1.6 Restore the file from the safe copy, change the first `Value' to `valUE', and the `Type' to `TYPE'. Now see what happens when you compile and run it with the following input: 1.0