A few people used the C/C++ title for character variables (i.e., char) rather than the Fortran title (e.g., CHARACTER).
Prob 2:
A number of people had problems with the concept of pointers. Unfortunately, I had assumed people knew the rudamentary concepts of pointers better from a previous course.
Prob 3:
No consistent problems.
Prob 4:
Both the DO and FORALL are (essentially) loops. It is true that the FORALL can take multiple "loop variable" and even some "masks" in the form of logical relations. But the main difference is that the FORALL loop is geared toward parallel machines, so that it is possible that part of the loop MAY be able to be done concurrently/simultaneously (i.e., in parallel) with other parts of the loop (but only if run on a machine that supports concurrent execution). It is able to do that because the FORALL loop does not specify the order in which the conditions are satisfied, whereas in the DO loop, the numerical counter is done in the order specified. The loop counter in either loop can take a "stride" value.
Prob 5:
Most people put something correct for each language. Fortran's negatives are really the "clunkiness" of older language style and structures, but, on some platforms, it can theoretically give higher precision than with C/C++ (if a compiler supports it).
Prob 6:
This problem was lengthy to grade in that for almost every
answer, the code had to be entered into a computer and compiled and run
to test if it was correct.
A few people forgot to initialize the ICOUNT counter variable.
A few people changed the original value of NORIG.
Prob 7:
One person put the variable x before the opening
parenthesis, rather than after the closing parenthesis. In
the second position, one reads the operations in the order
they are done from left to right, although both are algebraically
equivalent.
Technically, putting the variables first is NOT really
"Horner's Rule" and makes for difficult compiling.
Prob 8:
IANS should only be used on the left side of assignment statements as the return value computed for the base case (IANS = A(1)) or for the general case (IANS = A(N) + ISUM(A,N-1)).
Prob 9:
Some people forgot that Fortran allows subprogram names to be passed
as arguments in subprograms.
x
x
x
x
x x x x
30 40 50 60 70 80
(raw) (normalized)
mid2 nmid2
89 65
86 63
83 60
81 58
81 58
63 42
57 37
35 17
MAXIMUM 100 100
This page is maintained by Dennis C. Smolarski, S.J.
dsmolarski@math.scu.edu
© Copyright 2006 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 17 March 2006.