Programming Assignment Policy
Computer Science 102

Spring 1998

Style

Your program should follow the style guidelines below.

  1. Each program and unit should have a header comment at the top, with the following information: your name, the course name, your email address, and the assignment number. After this information, describe the purpose of the program or unit.

  2. Near the beginning of each of your programs and units, write a table of contents (inside a comment) that lists the name of each procedure and function you wrote.

  3. Break your program up into procedures (and functions). Each procedure should fit onto one or two screens if possible. Procedures on the same screen should be separated by a line of ****'s, or something similar. Each procedure and function should have a comment, right after its heading, giving its precondition and postcondition.

  4. Place comments in your program wherever something needs to be explained to the reader. Each non-trivial loop should have a comment. The variable identifiers should be self-commenting, e.g., answer, token, tree.

  5. Use a consistent indentation style that makes the structure of your program easy to read. Each begin should line up with the corresponding end.

  6. Strive for as clear and elegant a program as possible. Why come up with a convoluted solution if a simple solution is possible?

  7. Use constant declarations instead of ``magic numbers'' inside your program. Avoid using global variables. Avoid using the goto or break statements.

Collaboration

All projects are to be done individually. You may discuss the assignment with other students in a general way, but the design and coding of the program is to be done on your own. Copying will not be tolerated, and violators will be punished, possibly by failing the course.
Sam Marateck
Wed 28 20:54:54 EST 1998