Grading of Programs (Errors)
Page Last modified: 6 January 1999
I. Severe errors (these have many points off)
- A. address out of bounds. This happens when you try to
use or
modify a location in an array which is outside the storage you have set
aside for the array. This is the most severe error. Why? A large
variety of problems can be created which are very hard to track down.
Sometimes there may not be an outward indication of an error, except that
the numbers are nonsense. There are several ways this can happen: 1)
asking for element zero without allocating it, 2) misspelling an array
index or its limits, 3) integer round off of a mixed mode array index, 4)
mismatched declarations in main program and subprograms..
- B. subprograms that are inconsistent with the main program. This
includes failure to pass all the necessary variables between
subprograms. There are several types of errors here, but two are
especially common.
- mixed mode between subprograms. This is where
your subprogram expects one type of variable (integer, say) and your
calling program gives it the other type (i.e. floating point). What's
the problem? The two types of numbers are stored completely
differently.
- variable used in main program that is not
passed to or redefined in the subprogram.
- C. Logic errors that substitute a trivial task for a hard task.
Why? Because points are proportional to the amount of skill or effort
needed to complete the task correctly.
II. Other errors (these have fewer points off)
- A. Using an undefined variable. Some people may argue that
they are
working with the fact that the particular computer they are using sets
the variable to zero automatically. While that may be technically true,
this is in general a bad practice. Why? See the next item.
- B. Misspelling of a word. Common examples are mixing O and 0; l
and 1. If at all possible, you should use an indefinite set (preset all
variables to minus infinity). This forces you to define ALL variables
prior to use. Why? Otherwise a small spelling error may cause your
program to "run" but produce "garbage." The indefinite set means that
any time you try to use an undefined variable (because you misspelled it)
you will get an error message and thereby spot the problem much sooner.
- C. mixed mode. This is where you mix integers and floating point
variables. It may seem tedious or unnecessary to always include decimal
points (or not, in the case of integers) but it is a good habit to
develop. Why? Because it forces you to be aware that mixing the two can
be a problem in certain circumstances the worst being item I.B.1.
Another way is when the mixing gives you an unintended integer
round-off. Points are deducted when an incorrect value occurs.
- D. Other errors in logic. Obviously, many things are possible
here. e.g. The structure can't do what you intend. Common examples are
to reverse the order of do loops, to place things incorrectly inside or
outside do loops. Included here are using an approach specifically
forbidden by the problem assignment.
- E. Incorrectly defined variables. e.g. Pi is not 3.14, but
Pi=acos(-1.) is ok.
- F. Incorrect output. This may be because the requested materials
were not turned in. This includes providing figures or tables of
numbers that are not adequately labelled (e.g. Which curve is what?
Which column is what quantity?, etc.) don't assume someone "knows what
you mean" or "can figure it out". If you think about it, grading is
partly based upon assessing whether you figured something out; when you
leave it to the reader, you inadvertently raise the possibility that you
didn't figure it out.
Back to
ATM 150 homepage