CSCI 103 Summer 2018: Introduction to Programming
Please adhere to the following guidelines when submitting your code.
- IMPORTANT! Put your name and email at the top of every file you submit, as well as a brief description of the program (we suggest using a /* multi-line comment */).
- After uploading your files, use the "Check My Submission" button. If it says "failed" at the end, read the errors and try to fix them.
Good coding style will be one of the factors in your grade for each assignment. Follow these guidelines:
- Use proper indentation.
- Stay under 80 characters per line, otherwise your code becomes very hard to read when printed out.
- Use descriptive variable names. For example "sum" is clearer than "x".
- Use comments:
- Use a comment whenever your code does something non-obvious.
- Use a comment to explain the purpose of each high-level section of code. E.g.
// this loop reads the input
- Don't comment every line. Comments should make your program easier to read, not harder. But generally, it is safer to err on the side of too many comments than too few.
- Separate "paragraphs" of code with a blank line to aid readability.
- Don't use global variables.
- Global constants are okay.