For course policies regarding submission, grading, and collaboration, see the Policies page.
Submission
TL;DR: Grades come from completion credit (7%, code compiles) and code review credit (28%, explain your code to a TA). Submit any code via TigerFile before the deadline to earn completion credit.
How is my submission graded?
Your assignment grade is based on two components:
- Completion credit (7%): Earned by submitting any code that compiles by the completion deadline (1% per assignment).
- Code review credit (28%): Earned by demonstrating your understanding of the assignment during a one-on-one code review with a TA (4% per assignment).
The autograder does not determine your grade—it is a tool for feedback only. Your understanding and ability to explain your code is what matters most.
What are the completion deadlines?
Each assignment has a completion deadline. Submitting code that compiles by this deadline earns full completion credit (7% of your total grade). You do not need to pass all tests, just submit something that compiles.
The autograder is only available before the completion deadline. Use it to get feedback on your work while you're programming.
How do I submit an assignment for completion?
You must submit all assignments via TigerFile. We do not accept submissions via email, Ed, git, or any other method.
Here is a short checklist:
- Upload all of the required Java files. Filenames are case-sensitive.
- Submit the
feedback.txtandacknowledgments.txtfiles (see the first assignment specification for details on these).
On assignments that allow partnering, how do I submit?
First, you must form a group by clicking the green Create Group button in TigerFile. You must do this even if you are working alone (a group of one).
If you are working with a partner, add your partner as a group member. Your partner will receive an email with a link to confirm the partnership. Once you have created a group, any group member may submit.
Note: if you don't create a group and only one of you submits, then the other member won't get credit for the assignment.
Can I fix my code and resubmit?
Yes. There is no penalty for resubmitting files prior to the deadline. There is, however, a limit on the number of times you can receive autograder feedback using the Check Submitted Files button.
Autograder and Feedback
TL;DR: We provide an autograder on TigerFile for feedback only, it does not determine your grade. You have 10 checks per assignment, so test locally first.
What does the Check Submitted Files button do?
It compiles your code and checks that it conforms to the assignment specifications by running a battery of correctness tests. On some assignments, it also performs memory and timing tests.
It also runs three static code analysis tools—SpotBugs, PMD, and Checkstyle—that automatically identify common bug patterns and style issues.
Why is there a limit of 10 number of checks?
The limit is intended to provide timely feedback on your work while encouraging you to test and debug your code locally first, rather than relying on the autograder as your exclusive debugging tool.
Do I need to submit all required files to receive feedback?
No. The autograder will give feedback on whichever files you submit, provided that they compile. For example, you need not submit PercolationStats.java to receive feedback on Percolation.java.
I receive compiler errors or warnings. What does this mean?
Your programs should compile cleanly, with no errors or warnings. If you don't understand an error message, ask on Ed.
I receive SpotBugs, PMD, or Checkstyle warnings. What do these mean?
- SpotBugs looks for common bug patterns in your code. Treat anything it reports as an error (though occasionally there are false positives).
- PMD also looks for common bug patterns and code issues.
- Checkstyle looks for common style issues. Pay particular attention to the custom checks, which are specialized to each assignment.
The autograder reports "Process took too long and was killed." What does this mean?
This usually means that the autograder could not complete in the allocated amount of time. The most common causes are:
- A serious performance bug in your code
- Your program produces an enormous amount of output (perhaps you left in a debugging statement)
- An infinite loop
If you can't figure out why, please report on Ed.
Testing
TL;DR: Test locally before using the autograder (you only get 10 checks). Good testing helps your code review go smoothly.
Do I have to test my code?
Yes. Although the autograder tests your code, you are expected to test your code locally before using the autograder. Recall that you can only use the autograder 10 times.
For some assignments, we provide test clients for you to use. On others, we provide some instructions on how to write tests for your code.
Testing your code will help you make sure your code review with a TA goes smoothly!
What should my program do if the user specifies invalid input?
In general, professional programmers must write code to carefully check and validate any user input. In this course, however, you may assume the user specifies valid input unless the assignment specification explicitly says otherwise (e.g., "throw an IllegalArgumentException if...").
Java
TL;DR: Use our IntelliJ setup. Avoid Java library classes until we cover them in lecture. Review Sections 1.1-1.2 of the textbook for a refresher.
I haven't programmed in Java in a while. How much Java do I need to remember?
For a review of our Java programming model (including our input and output libraries), read Sections 1.1 and 1.2 of Algorithms, 4th Edition.
Which Java programming environment should I use?
We recommend our customized IntelliJ programming environment, available for macOS, Windows, and Linux.
If you followed our instructions, everything should be configured and ready to go. If you prefer to use another environment (such as Eclipse or VS Code), be sure that you can use command-line arguments, read from standard input, redirect standard input and output, and add algs4.jar to your Java classpath.
Can I use Java libraries like java.util.ArrayList or java.util.HashMap?
In general, do not use any Java library until we have implemented an equivalent version in lecture. Once we have introduced an algorithm in lecture, you are free to use either our version or the Java library equivalent.
You are always permitted to use common functions in java.lang such as Math.sqrt() and Integer.parseInt().