CS112 Programming Homework Guidelines
- Grading criteria
-
- Does it work?
Your programs should compile without warnings or errors.
They should give the correct answer on reasonable input.
You can get at most 30% of the maximum score if the program does not run.
- Is it still found correct after reading the code?
(The test set may not have revealed all bugs.)
- Comments and good programming style (see below)
- Comments
-
- A program header containing the name of the author, login name,
assignment number and date, and a very short description of what the program is about.
- Brief comments before the definition of each major procedure or
group of procedures detailing:
- What does it do?
- What does it take as input?
- Whate does it output?
- Preconditions or side effects (if any)
- Often it is possible to address all these items in at most two sentences.
- Similar explanation is expected for each non-obvious variable,
structure, or class declaration.
- Brief comments at any point in the program at which the reader
needs help in understanding. Comments which merely rephrase code
are unnecessary. Use of good variable names and
function names can help keep code self-commenting.
- Structuring and Naming
-
- Make the program largely self-explanatory by
arranging it in an intelligent way and giving informative names to your
variables and procedures.
Then fewer comments are needed since you must only comment the
non-obvious.
- Maintain consistent indentation.
- Follow the convention that constants should be all capital letters,
with multiple words separated by underscore "_".
- Variable names containing multiple words should be separated
by capitalizing (for example, myVariableName)
- The names must be self-explanatory not only for you but also for
others reading your code.