Assignments, CPSC 331, Winter 2012

home page -  news -  syllabus -  schedule -  assignments -  tutorials -  tests -  java -  references -  Mike Jacobson


Instructions -  Assignment 1 -  Assignment 2 -  Assignment 3 -  Assignment 4

 Instructions for Preparing and Submitting Assignments

Read This First!

Please read the online information about how to do well in this course as well as things to avoid if you have not already done so.

Requirements for Code

Coding Style

Code submitted by students for assessment in this course must be well designed and implemented. Please make sure to use proper programming style (which you have presumably learned about in prerequisite courses) when you write programs to solve problems in this course.

Documentation

Javadoc must used to provide documentation of all public methods that are included as part of your code — except for code that is developed only for the testing of other code. You will be expected to use the Javadoc tags @author, @param, @returns and @throws to provide information about your classes, and the methods they include. Information in the textbook and that is provided elsewhere in the web pages for this course should be sufficient for you to see how this should be done.

As noted above, you will not be required to document “testing code” this extensively. Instead you should use Javadoc to provide one or two lines of information about each test class that you write, in order to describe the method(s) that is being tested by this class or to say a little bit about how it is being tested, here.

You will also be expected to include preconditions and postconditions for public methods (except for methods that provide tests to be run under JUnit). Unfortunately there are no standard Javadoc tags that can be used to provide this information. However, additional information (such as a precondition and a postcondition) can be provided using HTML. If you are not familiar with HTML then you may use the first Fibonacci method that was provided for use in the second self-study exercise as an example to follow. If you are familiar with HTML and wish to format this information differently — please go ahead (as long as the markers are able to find this information). Note, though, that a simply formatted specification of requirements that is correct will receive more marks than an incorrect specification of requirements that looks pretty.

It is good practice to include loop invariants and loop invariants for all loops in your source code as inline docmentation. The second Fibonacci method that was provided for use in the above-mentioned self-study exercise includes a loop invariant and a loop variant as inline documentation. You may use this an example to see how these can be included in such documentation.

Additional intermediate assertions that are unlikely to be obvious to a reader of your code, but that are needed for a proof of its correctness, should be included as inline documentation too.

Testing

It is expected that all code that you submit will have been thoroughly tested before you submit it.

Indeed, several of the assignments will ask you to submit reports on the process that you followed to design and carry out tests on your code as well as suites of tests that can be executed using JUnit.

Requirements for Other Written Material

Assignments will generally ask you to include a written report. Indeed, an assignment may include several questions that require additional written information along with (or instead of) code.

It will often be a good idea to include a short written report for the questions that simply ask for code too! You can do this to provide information about the design process that you followed to develop code, to provide information about the algorithms and data structures that you chose and implemented, or to document any assumptions that you made.

Please note that the quality of writing will be assessed in this course. Therefore the written reports that you provide must be well-written documents. They should be well-organized documents, consisting of seveal paragraphs that are each composed of one or more carefully and clearly written English sentences.

Yes, marks might be deducted for spelling and grammatical errors: After all, you do have access to tools that you should be using to search for and remove these.

Since the quality of your writing will be assessed, the following is advisable: Make sure to complete first drafts (indeed, even second drafts) of all written material several days before your submission is due. Then set it aside while you rest, or work on other things. You will probably find, when you come back to it with “a pair of fresh eyes,” that you notice writing problems that you would not have found otherwise.

Indeed, if you are submitting material in a group of two or more students then it is advisable to assign the job of “author” of a written answer to one student, and to assign the job of “editor” of the same material to another student in the group: Most of us are, generally, very poor editors of our own written material.

Please prepare your written answers as a Microsoft Word (“.doc”), Postscript (“.ps”) or PDF (“.pdf”) file in order to be sure that markers can open and read your material. It is not guaranteed that you will be given the chance to resubmit your material if you ignore this instruction and markers are unable to read what you have written.

Submission of Your Assignment

File names can be changed when files are submitted using Blackboard, and this can complicate things when you submit programs. Please submit a single file, using the following instructions, as your solution for each assignment in this course.

  1. Move Your Files into a New Directory.

    When you are ready to submit your solutions for an assignment create a new directory (preferably named after the assignment) and move all (and only) the files that you wish to submit into this directory.

  2. Generate an Archive File.

    Use the Unix tar command to produce a single “tar file” that includes the contents of this directory.

    You should do this by executing the command

    tar –cvf archive.tar AssignmentDirectory

    in the directory above the directory with your assignment files — that is, in the directory that contains your assignment directory — where archive.tar is the name you wish to give to the “tar file” that you wish to create, and where AssignmentDirectory is the name of the directory that stores your assignment files (which you have created already).

    After you have done this, you should find that a new file called archive.tar has been created, in the same directory as the one that contains the directory storing your assignment files.

    For example, if I have a directory called CPSC331 where I store all my files for this course, then I would probably create a new directory called Assignment1 inside my CPSC331 directory, and I would use the directory Assignment1 to store my files for the first assignment in this course. Just before submitting material for the first assignment I would make sure that Assignment1 includes the files I wish to submit. Then I would execute the command

    tar –cvf assignment1.tar Assignment1

    within my CPSC331 directory in order to create a file called assignment1.tar

  3. Compress Your Archive File.

    After doing this, use the Unix gzip command to compress your archive file, by executing the command

    gzip archive.tar

    where archive.tar is the name of your archive file.

    You should find, after this, that your file archive.tar has been replaced by another file whose name is archive.tar.gz.

    For example, if I named my files as described above then I would execute the command

    gzip assignment1.tar

    in order to create a file with name assignment1.tar.gz and this is the file that I would submit using the course’s Blackboard page.

    Note: You will not necessarily be given a chance to resubmit your assignment if you use different software (for the archiving of files and for file compression) than the software listed above, and if the resulting submission is not readable by the teaching assistant and instructor! Other file compression software (notably including various versions of the WinZip utility) generates archives that are frequently caught and rejected by virus protection software.

  4. Select Your Compressed File Using the File Selector in the Assignment Area, in Blackboard.

    Go the the area for the assignment in the course blackboard page. You should see that this includes

    • an “Assignment Information” area, where a copy of the assignment can be downloaded,
    • an “Assignment Materials” area, that you can use to give feedback and upload your assignment solution, and
    • a “Submit” area that you should use when you are finished with the assignment.

    The middle “Assignment Material” area includes a file selector that you should use to upload your solution.

  5. Complete the Submission Process:

    Press the “Submit” button when you are finished.

    Note: To my knowledge it is only possible to submit material by pressing the “Submit” button once!

    Furthermore, pressing “Save” does not submit your work for you, so that it will not be seen or graded if you select this instead of “Submit,” by mistake.

    Please send email to the course instructor as soon as you can, if you discover that you wish to resubmit material (perhaps, in order to correct a mistake), or if you realize that you did not “submit” your material before an assignment was due.


Last updated:
http://www.cpsc.ucalgary.ca/~jacobs/Courses/cpsc331/W12/assignments.html