Comments on FORTRAN program 2

S -  was explicitly in the specification

Comment #

Comment

Points deducted

 (if any)

  1.  

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

  1.  

The RETURN statement of a subprogram returns control to the calling program.

 

  1.  

The STOP statement stops the execution of the program.

 

  1.  

The END statement signifies to the translator that the end of the program unit has been reached.

 

  1.  

Mistake in spelling or in word use

-1 each (max -5)

  1.  

Comments should fit on a single line and should not wrap around on your printout.

-1 (more off in future)

  1.  

Formal and actual parameters should not have the same names.

-1 (each subprogram) 

   (more off in future)

  1.  

The input of the program must be described.  A detailed description is better than a sketchy one.

-5

  1.  

Input data should always be checked for validity even if the client doesn’t tell you to check it.

-3

  1.  

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. 

 

  1.  

The program was supposed to describe itself to the user. (S)

-5

  1.  

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

  1.  

The heading should have the correct date

-1

  1.  

The output of the program must be described. 

-5

  1.  

All output data should be labeled.

-3 (more in future)

  1.  

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

  1.  

Sort was supposed to sort the numbers in descending order. (S)

-5

  1.  

Numbers were not to be printed in the SORT3 subroutine. (S)

-5

  1.  

Numbers were not to be printed in the SWAP2 subroutine. (S)

-5

  1.  

You used PRINT *  , READ * , WRITE (6,*) or READ (5,*)

-5

  1.  

Inadequate comments about FORTRAN language

-5 to -10

  1.  

Inaccurate comment  about FORTRAN language

-1 each

  1.  

Missing carriage control character at start of output FORMAT statement.

-2 each

  1.  

Disk unreadable

-10

  1.  

Executable doesn’t run

-10

  1.  

Unnecessary initialization

-1 each

  1.  

Unused variable

-1 each

  1.  

Wrong form of IF statement

-3

  1.  

Wrong form of DO

-3

  1.  

Your input FORMAT does not meet the specification (S)

-5

  1.  

You are missing RETURN statements from your subroutines

-1 each

  1.  

You are missing a STOP statement from your main program

-3

  1.  

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

 

  1.  

Program specifications did not require a loop and using one cause non-conformant output

-3

  1.  

Your output doesn’t conform to your introduction to user

-2

  1.  

Unnecessary statement or symbol

-1

  1.  

Inaccurate subroutine description

-1

  1.  

Using A format

-3

  1.  

No internal comments

-5

  1.  

Wrong comparison operator  (e.g.  < instead of .LT.)

-3

  1.  

Unreachable statement

-1

  1.  

Performing the sort operation twice for no reason

-3

  1.  

Program specifications said input data was integers (S)

-5

  1.  

Use of lower case

-5

  1.  

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

  1.  

Your program doesn’t pass parameters

-7

  1.  

Your program is missing an END statement

-3