Comments on FORTRAN program 2
S - was explicitly in the specification
Comment # |
Comment |
Points deducted (if any) |
|
Variables beginning with I through N do not have to
be declared as INTEGER. They should
not be declared as INTEGER because declaring them indicates that you
don’t know the default rule. |
-3 |
|
The RETURN statement of a subprogram returns control
to the calling program. |
|
|
The STOP statement stops the execution of the
program. |
|
|
The END statement signifies to the translator that
the end of the program unit has been reached. |
|
|
Mistake in spelling or in word use |
-1 each (max -5) |
|
Comments should fit on a single line and should not
wrap around on your printout. |
-1 (more off in future) |
|
Formal and actual parameters should not have the
same names. |
-1 (each subprogram)
(more off
in future) |
|
The input of the program must be described. A detailed description is better than a
sketchy one. |
-5 |
|
Input data should always be checked for validity
even if the client doesn’t tell you to check it. |
-3 |
|
It’s a good idea to immediately echo the input data
so you the programmer know what the computer ‘got’ in case your program
doesn’t do what you think it should. |
|
|
The program was supposed to describe itself to the
user. (S) |
-5 |
|
The purpose of the program must be described. The purpose is what the program
does, not what I want you
to learn from it. |
-5 |
|
The heading should have the correct date |
-1 |
|
The output of the program must be described. |
-5 |
|
All output data should be labeled. |
-3 (more in future) |
|
The output data should be easily readable (i.e.
numbers should be spaced so that the reader can tell where one ends and
another begins). |
-5 |
|
Sort was supposed to sort the numbers in descending
order. (S) |
-5 |
|
Numbers were not to be printed in the SORT3
subroutine. (S) |
-5 |
|
Numbers were not to be printed in the SWAP2
subroutine. (S) |
-5 |
|
You used PRINT *
, READ * , WRITE (6,*) or READ (5,*) |
-5 |
|
Inadequate comments about FORTRAN language |
|
|
Inaccurate comment
about FORTRAN language |
-1 each |
|
Missing carriage control character at start of
output FORMAT statement. |
-2 each |
|
Disk unreadable |
-10 |
|
Executable doesn’t run |
-10 |
|
Unnecessary initialization |
-1 each |
|
Unused variable |
-1 each |
|
Wrong form of IF statement |
-3 |
|
Wrong form of DO |
-3 |
|
Your input FORMAT does not meet the specification (S) |
-5 |
|
You are missing RETURN statements from your
subroutines |
-1 each |
|
You are missing a STOP statement from your main
program |
-3 |
|
If your program doesn’t process data because it is
invalid, it should say so – not just quit – leaving the user to wonder what
happened |
|
|
Program specifications did not require a loop and
using one cause non-conformant output |
-3 |
|
Your output doesn’t conform to your introduction to
user |
-2 |
|
Unnecessary statement or symbol |
-1 |
|
Inaccurate subroutine description |
-1 |
|
Using A format |
-3 |
|
No internal comments |
-5 |
|
Wrong comparison operator (e.g. < instead of .LT.) |
-3 |
|
Unreachable statement |
-1 |
|
Performing the sort operation twice for no reason |
-3 |
|
Program specifications said input data was integers (S) |
-5 |
|
Use of lower case |
-5 |
|
Variables beginning with the letters A through H and
O through Z are real not integer. If
you want them to be integers, you have to explicitly declare them as such |
-3 |
|
Your program doesn’t pass parameters |
-7 |
|
Your program is missing an END statement |
-3 |