Standard FORTRAN IV Questions KEY - 24 points maximum
Due Thursday, October 12 at start of class – must be printed -5 for handwritten answers
Name ________________________
(1) 1. What are the delimiters used to surround an array index?
parentheses OR
( )
(1) 2. Where do FORTRAN array bounds start?
1
(1) 3. Why is it not necessary to declare all variables in FORTRAN?
because identifiers that start with any of the letters i through n are by
default integer variables and all others are by default real
(1) 4. Where are subprograms placed physically in a standard FORTRAN program?
either before or after the main program
(1) 5. Is FORTRAN case sensitive?
no
(1) 6. Does FORTRAN allow mixed mode arithmetic?
yes
(1) 7. Does FORTRAN have any reserved words?
no
(1) 8. How many different types of subprograms are there in FORTRAN?
2 (subroutines and functions)
(2) 9. Suppose you declare a 10 element array of integers, assign values to 8 of the elements and print out all 10 elements. What happens in your version of FORTRAN? (what version do you have?)
answers will vary – needs
what happens is shown and version is shown
(2) 10. Suppose you declare a 5 element array of integer and attempt to print out the 6th through 10th elements. What happens in your version of FORTRAN? (what version do you have?)
answers will vary – needs
what happens is shown and version is shown
(1) 11. Does FORTRAN allow you to dynamically allocate storage? If so, how is it done?
no (not in FORTRAN IV)
(1) 12. What is the FORTRAN symbol for the relational operator 'not equal'?
.NE.
(1) 13. In FORTRAN, which has higher precedence .AND. or .OR. or do they have equal precedence?
.AND.
(2) 14. What are the Boolean values in FORTRAN?
.TRUE. .FALSE.
(1) 15. What FORTRAN type is illustrated by the type LOGICAL?
variables that hold values true or false
(1) 16. Does FORTRAN have variables of an enumerated type?
no
(2) 17. What is the major difference between a FUNCTION and a SUBROUTINE
functions return a single value by assignment to the function name
subroutines
return 0, 1 or many values through the parameter list
(2) 18. How long can an identifier be in your version of FORTRAN? What is your version?
answers may vary - need a number and a version
(1) 20. What is the method of parameter passing in FORTRAN
pass
by reference OTHERWISE KNOWN AS pass by address