APS101: Rules for Assignment 1

In this course, you will be submitting most of your assignments electronically. We will be printing them for the TAs to mark, and we will also do a lot of automatic testing. Read and follow the following rules carefully.

We apologize for having to be so strict, but remarking takes a huge amount of time per assignment -- and with so many students, it becomes intractable.


The most important rules

If you violate any of the following rules then you may get a zero on some or all parts of the assignment, WITH NO APPEAL ALLOWED. (Please notice that you have to go out of your way to violate them!)

  1. Put only one public class in each .java file.

  2. Submit your .java files (the source code), not your .class files. Do NOT rename your .class file to make the electronic submission work.

  3. Don't ever use package statements, even if your favourite IDE inserts them automatically. Delete them if they appear.

  4. Capitalization matters in Java, including in filenames. This means that class names must match the filenames exactly. For example, if your class is called AssignmentZero, your file must be called AssignmentZero.java, and not assignmentzero.java or Assignmentzero.java. Use the capitalization asked for in the handout and starter code.


Style Rules

If you violate any of the following rules you will lose substantial style marks.

  1. Use Java style conventions for your method and variable names (start with a lowercase letter, use lower case except for the beginning of a new word within the name).

  2. Write a good comment for each class, each instance variable, each static variable, and each method.

    Your method comments must mention what, if anything, the method returns, and the purpose of each parameter. The comment must be grammatically correct.

    The variable comments should be brief and just say what the variable is used for. They should also be clear and grammatically correct.

  3. Each line must be less than 80 characters long including tabs and spaces. Beware of "soft returns" -- some word processors, like WordPad, wrap lines automatically. If you use such a program, make sure that you press the return key yourself.

    DrJava tells you what column you're in. Look in the lower-right corner.

  4. Use a tab width of 2 (DrJava's default), if you use tabs at all. The best way to make sure your program will be formatted correctly is never to mix spaces and tabs -- use only tabs, or only spaces. If you use a tab width of less than 2, it is your responsibility to make sure that your lines are shorter than 80 characters when we print your program. DrJava is set up at school to use a tab width of 2, and you can do that at home, too, in almost all IDEs.

  5. Put a blank line before every comment that appears on a line by itself.

  6. Put a blank space before and after every operator. For example, the first line below is good but the second line is not:

              boolean b = 3 > x && 4 - 5 < 32;
              boolean b = 3>x && 4-5<32;
                
  7. When breaking up a long line break it before an operator, not after. The first example below is good but the second is not:

              boolean b = "Hello".charAt(3) + 3 > x
                && Integer.parseInt(s) < 32;
    
              boolean b = "Hello".charAt(3) + 3 > x &&
                Integer.parseInt(s) < 32;
                
  8. Place opening brace on the same line as the method/class header. The first example below is good, but the second is not:

       
    	    public void blah() {
    	        ...
    	    }
    
    	    public void blah()
    	    {
    	      ...
    	    }
                

Some tips on how the system works

  1. If you resubmit a file, that is the only copy we will have. Your old submission will be overwritten, including the timestamp.

  2. It's okay to submit extra files. We will ignore all files that we didn't ask for.

  3. There may be marks given for a program that compiles, but does not produce correct results. Thus, it is always in your best interest to turn in something that compiles.

  4. It is possible that these rules will be overridden for particular assignments. Any such changes will be announced in class or on the web site.