Code Guidelines
Subject to change… please see your current classes resource folder for the most up to date copy of this document.
If you do not follow these rules, points will be taken off your assignment. Do not edit your output. If you change your program, you need to compile and re-run your program to generate ALL the output again. Turn in all pages of your output from your final run, do not only hand in those pages where the output is from any previous run. If your program does not produce any output, comment that in your program listing. Homework without output will have points deducted. Do not scribble anything in your program listing, only the printed code will be graded.
Tips
- The name of the program might need to be the same as the file name of your (.java/.cpp) file.
- Save your new file using (.java/.cpp) extension before typing your code so that the IDE will highlight the keywords and indent the program correctly for you.
Requirements
- Include a comment block at the beginning of the program using the following format.
/*
* Name:
* Section: ITSE####
* Homework PG###P##
* Description */
- Capitalize every word in program names / class names. Example: JavaProgram CppProgram.
- Use meaningful variable and constant names.
- Begin variable names with a lower case letter using the single letter prefix and capitalize internal words. Example: fTotalAmount. Letter prefix are as follows: i = integer, f = float, c = class, d = double, c = character, s = String, b = Boolean, and o = object.
- Use named constants appropriately in your program. Use all uppercase for named constants be sure to include the single letter prefix.
- Use blank lines to separate different sections of your code.
- Put a space before and after each operator.
- Indent your code correctly. Place opening braces as far left as possible without obscuring the previous opening brace. Indent all code between the opening and closing braces 4 spaces to the right of the braces. Match the closing brace with the opening brace.
- Do not type beyond your screen (max 70 characters per line); otherwise your printed code will not look correctly indented. Make sure your printed code does not go off the page. If a line is too line to fit on a line of the printed page, use multiple lines and indent subsequent lines appropriately.
- Comments are required for each class and method.
- Use local variables, parameters, and instance variables appropriately.
How To Turn in Your Programs
- Run your program.
- Select the source files and resulting java/cpp classes compress them using winzip, or other zip compression program. Name the resulting compressed file with your initials, the letters ‘pg’, the page number, the letter ‘p’ and the problem number. Or if there is no page number then enter your initials and the main class name. Example file name: crmpg257p2.zip.
- You will then email the attachment to your instructor.
How To Print Your Output and Program
- Run your program.
- To print your output, highlight all the output in the DOS/Console window, click on the icon in the top left corner of the DOS/Console window’s title bar, select Edit->Copy Enter. Create a NEW EMPTY document and paste into the new empty document. Do not change or add anything. Select File->Print.
- To print your program, you need to ensure that the program is displayed in the code pane (by clicking on the program’s name in the document selector in the left pane) and then select File->Print.
Grading Scale
You will earn 10 points for each of the following items:
- Coding Guidelines followed
- Programming task completed
- Flowchart/Pseudo Code
- Comments
- Output
- Algorithm
- Best possible use of language
- Input
- Use of appropriate class material you have been exposed to
- Good programming practices