Assignment FAQ

What's the difference between the assignment and the checklist? The assignment provides the programming assignment specification; the checklist provides clarifications, test data, and hints that might be helpful in completing the assignment.

Where can I find the course policies regarding submission, lateness, grading, and collaboration? The syllabus.

Do my programs need to handle every conceivable input? No. Your program must handle all meaningful inputs, but you need not worry about meaningless ones. For example, when testing RGBtoCMYK.java, we will always supply three command-line arguments that are integers between 0 and 255.

How will I access my work after it has been graded? You will login to codePost, a system designed by Princeton undergraduates to streamline our grading workflow.

Submitting your work

Can I submit assignments via email, hardcopy, or Snapchat? No, all assignments submissions must be done via TigerFile.

What's TigerFile? A web-based system that you will use to submit assignments. Every assignment has its own submission link on the Assignments page.

When I login to TigerFile, my browser asks me whether I should accept a "security certificate." How should I proceed? Accept it permanently. We need to establish a secure connection so that you can submit assignments with reasonable privacy.

How do I successfully submit an assignment?

Can I correct my program and resubmit? Absolutely. That's the point of this sytem. There is no penalty for resubmitting files prior to the deadline.

When I submit a file, TigerFile reports Filename is not in list. Why is it rejecting my submission?

Be sure the file has the correct name. Both the capitalization and .java extension are important. We recommend configuring your system to show the file extensions. Here are instructions for Mac and Windows).

How do I submit an assignment after the deadline? You must mark the checkbox in TigerFile that indicates that your work is incomplete. Otherwise, we will grade your most recent submission when we begin grading. When you are ready to have the assignment graded, uncheck the checkbox.

I will be submitting late checkbox
There is no need to mark (and unmark) the checkbox if you are submitting before the deadline.

On assignments that allow partnering, how do my partner and I submit? One partner submits all of the required files and a full readme.txt file; the other partner submits a special abbreviated readme.txt.

On assignments that offer a Challenged for the Bored, how should I submit my solution? You shouldn't. They are solely for your own enrichment, not extra credit.

"Check All Submitted Files"

What exactly does the Check All Submit Files button in TigerFile do? It compiles and executes your program on the inputs specified in the assignment specification. It also runs two tools, Findbugs and Checkstyle, that automatically identify common bug patterns and style issues in Java programs.

Must I submit all of the required files to receive feedback? No, you will receive feedback on whichever files you submit.

What should the output look like, if there are no errors or warnings? Here is an example.

I receive various compiler errors and warnings. What does this mean? Your programs should compile cleanly, with no errors or warnings. Consult a staff member if you are unsure how to fix them.

I receive various Findbugs warnings. What does this mean? Findbugs is a program that looks for common bugs in your program. You should consider anything it reports an error (though there are occasionally false positives). Consult the course staff if you are unsure what an error message means or how to fix it.

I receive various Checkstyle warnings. What does this mean? Checkstyle is a program that looks for common style issues in your program. The appearance of a warning message does not necessarily lead to a deduction (and, in some cases, it does not even indicate an error). However, if you are learning to program in Java, you should strive to fix any issues that Checkstyle flags. You should pay particular attention to the custom checks, which are specialized to each program. Consult the course staff if you do not understand an error message or how to correct it.

I receive the Checkstyle error message Incorrect COS 126 header format. How do I fix this? At the top of each file, include a header in the specified format.

Will Checkstyle ever like me? No, Checkstyle is a computer program. However, as you gain programming experience, you'll get used to the myriad (and sometimes seemingly arbitrary) conventions that good programmers employ, and you will learn to like Checkstyle.

I receive various FAILED messages in the correctness tests. What does this mean? Your program does not meet the assignment specifications on the tested inputs. Failing any of these tests will lead to a deduction. (Passing all of these tests is a good sign, but does not guarantee that your program is 100% correct; we run a more substantial set of correctness tests when grading.) Consult the course staff if you do not understand the error message.

I receive the error Process took too long and was killed (output may be truncated). What could cause this? This usually means that the autograder could not complete in the allocated amount of time. One common cause is an infinite loop. Another possibility is that your program produces an enormous amount of output, perhaps because you left in a debugging statement.

readme.txt

What is a readme.txt file? It is a plain text file that contains a narrative description of your work. This is the first thing the grader will read. Each week, we'll provide a template readme.txt file. Be sure to answer any questions that it contains.

Which program should I use to edit the readme.txt file? Use IntelliJ. Be careful to save the file as readme.txt and not as a .java file. The readme.txt file must be a plain text file. Note, Microsoft Word .doc or .docx formats and Mac TextEdit .rtf formats will not be accepted. Please do not rename your .doc, .docx, or .rtf file to .txt as this will cause your file not to be readable by our system.

On assignments that allow partnering, what should go in the partner's readme.txt file? The assignment will provide a special abbreviated readme.txt template.

Header

What is the proper format of the header for Java programs? Here is an example for an assignment with no partner.

/* *****************************************************************************
 *  Name:    Alan Turing
 *  NetID:   aturing
 *  Precept: P00
 *
 *  Partner Name:    N/A
 *  Partner NetID:   N/A
 *  Partner Precept: N/A
 *
 *  Description:  Prints 'Hello, World' to the terminal window.
 *                By tradition, this is everyone's first program.
 *                Prof. Brian Kernighan initiated this tradition in 1974.
 **************************************************************************** */

The header must appear at the very beginning of the Java file and follow the formatting above (e.g., the first line consists of the forward slash character, followed by 78 asterisks). You are free to add additional information after the description section of the header (such as instructions for compiling, executing, and listing any dependencies) but this is not required.

How strictly must I adhere to the formatting requirements? You should strive to match it exactly. We recommend cut-and-pasting the above template. However, if you use only 75 asterisks on the first line (instead of 78), that will be accepted.

What is the format of the header for the readme.txt file? It is the same as for Java programs, except no description is required.

/* *****************************************************************************
   *  Name:    Alan 
   *  NetID:   aturing
   *  Precept: P00
   *
   *  Partner Name:    Ada Lovelace
   *  Partner NetID:   alovelace
   *  Partner Precept: P00
   **************************************************************************** */

May I use non-ASCII characters in the header? Yes. However, if you use non-ASCII characters, they must be Unicode and encoded using UTF-8.

IntelliJ

Which Java programming environment should I use? We strongly recommend using IntelliJ for this course.

How can I download a program from the textbook? The booksite contains links to all of the Java programs in the textbook. Each link goes to an HTML file (such as UseArgument.java.html) that is suitable for display in a browser. You can copy-and-paste the code into IntelliJ as needed, with appropriate attribution. The HTML file contains a link to the Java source file (such as UseArgument.java); you can right click this link and save the file to your computer.

How should I read in user input? It depends on the assignment. If the assignment specifies command-line arguments, your program should accept command-line arguments; if the assignment specifies standard input (starting on Assignment 2), your program should accept input from standard input. You will receive a significant deduction for not following these directions.

May I use (advanced) features of Java that have not yet been covered in the course? No, your code should use only the Java language features previously introduced in the course. For example, you may not use an if statement or a for loop on Assignment 0.

Style

How should I format my code? Here are some recommended style guidelines. Below are some that are particularly important (and for which you risk losing points if you ignore).

How should I compose a program?

How should I comment my code? Below are some that are particularly important (and for which you risk losing points if you ignore).

Project Files

How can I extract the .zip file associated with an assignment? You must use the project folder with IntelliJ. This is provided as a .zip file. Often associated data files that are useful for testing are included. They are bundled together in a .zip file, which you will need to extract: