A trace print
is a statement or sequence of
statements that are present for debugging.
Such prints can be left in the program, but it
must be easy to turn them on or off. Write
if(trace > 0) { ... }where trace is an integer global variable that indicates the level of tracing, and 0 might be replaced by 1, 2, etc. |
A trace print should be left in the program but made controllable. It should not be commented out. |
For this class, write all trace prints to the standard output. (Larger programs often have provisions to write traces to files.) |
Every trace print should show:
if(trace > 0) { printf("getCompatibility: [top of loop] working on k = %i\n", k); } |