Assignments
Specifications, supporting files and solutions to all assignments will be posted here as they become available.General Assignment Material
There are two files to read over before submitting an assignment. The first are instructions for assignment submission. These regulations you must follow or else risk losing many points on the assignment. There is also a 2nd file, which is programming guidelines. The purpose of this file is to take some of the useful guidelines and tips that were originally in the instructions file and separate them. These are things that you should follow as closesly as you can. However, failure to do so will only result in a few points deducted (if any) as the guidelines are not always easy to follow and are often subjective. In otherwords, the file Instructions (instructions.pdf) has to do with COMP-202 regulations that you must follow in order to make grading as easy as possible. These will be things such as submitting your assignment on mycourses, submitting it ontime, etc. The ProgrammingStandards.pdf file contains general guidelines that are good to keep in mind while programming and are not COMP-202 specific.
Assignment 1
Due Monday January 28th, 23:55. Stay tuned to the course webpage for any updates/clarifications on the assignment!Assignment 2
Due Monday February 25th, 23:55. See important note below! Stay tuned to the course webpage for any updates/clarifications on the assignment!- Specification
- AssignmentTwoTests.java This code contains tests that you must run with your program to check it's output. It is not a substitute for testing separately on your own, but will serve as a good starting point.
- SampleRunSin.txt Sample run of question 1
- PlagiarismDetector.java (Sample main method to start with for question)
- Although the assignment is due after the midterm, it is HIGHLY recommended that you complete question 1 (The TaylorSin program) BEFORE the midterm. Doing so is the best way to practice/learn the material covered for the exam.
- Important note about due date:Many students have asked me about an extension for assignment 2 so that they can work on it during reading week. We would like to leave the deadline before the break to encourage people to hand in their assignment, BUT we will be accenting late assignments without any penalty until Tuesday March 5th 11:59 PM. This means that if you hand in your assignment before then, it will be counted as on time. Assignments handed in after Tuesday will not be given a stricter penalty than the normal 10% per day as we need to make sure the TAs have time to grade the assignments. Also, assignment 3 will still be posted next week regardless. -Dan
- Hint on Plagiarism question Many of you have asked me during office hours how you can detect duplicates in the PlagiarismDetection. Note that you do not need to (nor should you) have any code related to duplicates. For example, if one String is "a a a" and the other is "a b c" You would say that every word in the first String is contained in the second and the ratio would be 3/3. One way to start this is by writing a method public static boolean contains(String[] array, String element) that checks whether element is part of array. Once you have this method you can go through your entire first array, one element at a time, and count how many times that element is part of the other element. You can then calculate the ratio by dividing by the total length of the array.
- Solutions: TaylorSin.java
- PlagiarismDetector.java solutions
Assignment 3
Due- Specification
- CardPile.java (support code for the assignment)
- ComputerPlayer.java (support code for the assignment) : Updated to improve consistancy between ComputerPlayer and HumanPlayer
- Hearts.java (support code for the assignment)
- HumanPlayer.java (support code for the assignment)
- Player.java (support code for the assignment)
- Value.java (support code for the assignment)
- Suit.java (support code for the assignment)
- EnumExample.java (support code for the assignment)
- SupportCode.zip (same as the above but zipped for possible convenience)
- UPDATE: AssignmentThreeTests.java Some *very* rudimentary tests to check if you are on the right track for questions 1 and 2
Assignment 4
Due Tuesday April 16th, 23:30. I recommend that you start as soon as possible. At least download the Spaceracer project and make sure that the computer you are planning to use will run the game. In case the game does not run on your system, use the computers in the Trottier labs!Stay tuned to the course webpage for any updates/clarifications on the assignment!
- Specification
- Zip file with Spaceracer (92.4MB) (updated April 5th! Now, the ship will not perform weird "looping-style" movements when you continue to move upward / downward when the spaceship is at the border of the race.)
- Windows libraries that might fig the "java.lang.UnsatisfiedLinkError: Can't load library: lwjgl.dll" error when running within Eclipse. Simply unzip the file and put all the dlls into the root Spaceracer folder, replacing any existing libraries there. This fix won't work with DrJava.