Homework Policy
No Compile No Credit
Unfortunately we can not award any credit for programs that don't compile.
Document Your Code with Comments
Put a comment at the top of your file with your name, course name, date, homework
number, collaborators, and anyone else (with the exception of course staff) who
helped you. Each file should have a comment at the top, and each non-trivial method/function
should have a comment above it.
Method/Function Headers
To get full credit, method/function names, return types, and
parameter number/order/types need to be exactly as specified. Otherwise our testing software will not
recognize them and will be unable to call them (to test them) or give credit for them. Our primary means of testing is to supply input to a method/function and to see if the expected output is returned.
Methods/Functions that Print
To facilitate your debugging process, we strongly encourage you to print output (with Java's System.out.println method or C's printf function) to help you know what your program is doing and when. However, our grading software completely ignores this output. Instead, it looks at values returned by methods/functions. Unfortunately we can not award credit for a value that is printed out with println() or printf() instead of being returned by a method/function.
In fact our graders are happiest when submitted programs print NO output - they run faster that way. If you have a lot of println/printf statements in your program, we appreciate it if you commment them out in the version you submit to be graded.
Invalid Method/Function Arguments
At the beginning of the course, unless otherwise specified in the problem
statement, assume that methods/functions will only be called with arguments that make
sense for the problem statement.
Homework Submission
- You may submit your homework up to 5 times. If there are multiple files to be submitted, submit all files each time. The late policy is given on the Syllabus.
- We recommend that you keep a copy of the web page that acknowledges the receipt of your homework.
- If you have any questions, or if the submission page for a given homework is not in place when you expect it to be, let us know by postingto the bulletin board. If you are asked to submit a file and it is designed to work with other code, we need to put that code in the submit directory's "supple" (supplementary) directory to prevent compiler errors. Some times we forget. If you do, please let us know :)
File Extensions - Be Careful to Submit the Right File, NOT One That Ends With "~"
- A common caveat in homework submission is submitting the wrong file. A file that ends with "~" (for example hello.java~, or hello.c~) is a backup file made by DrJava/emacs/vi, or whatever software you use to create your programs. Be careful not to submit the one that ends with "~", because that's a backup/old version of your file. You want to make sure you submit the latest version.
- C Programmers: this document is done as far as you're concerned.
- Java Programmers, read on:
- The way Java and DrJava work, there are three separate files generally. For example, if the program you are writing is called counter, the following files exist:
Counter.class |
The actual "program" itself - this is the file that is produced upon compilation of code. |
Counter.java |
The code for the program/class file - this is the file that you actually write. |
Counter.java~ |
A BACKUP copy of the code, generated by DrJava. This will most likely NOT be the most recent version! |
- If you are running Windows, the potential for confusion of the three files is even greater. By default, Windows does not show the file extensions, so chances are that when you go to submit your homework, you will just see three files named "Counter" and arbitrarily pick one. This is not acceptable.
- In order to prevent confusion, you need to explicitly change your settings to see all file extensions. The following are directions for Windows XP. If you need directions for another version of Windows, please ask your TA.
- Open Windows Explorer by right-clicking on the "My Computer" icon in your start menu or desktop and click "Explore"
- Go to the Tools > Folder Options menu
- Click the View tab
- Scroll down and UNCHECK the box that says "Hide extensions for known file types"
- Click Apply
- Click OK
- You should now be able to differentiate between .class, .java, and .java~ extensions
- Traditionally we have been very lenient in allowing re-submission of erroneous files (i.e. .java~ instead of .java). We do not plan to continue this policy for long, and so it is your responsibility to ensure that you submit the correct file!
- If you feel that you still cannot differentiate between the files you should be submitting, please post to the bulletin board or contact your TA.