All assignments are individual work. We use MOSS to detect software plagiarism.  Any evidence of copying will be considered a breach of academic honesty and will be dealt with accordingly (see www.cse.yorku.ca/admin/coscOnAcadHonesty.html for more information).

Assignment 2 is now due at 11:59pm Thursday Oct 29th. Late assignments will not be accepted.  There are no exceptions.

Both questions below defines a new package, i.e., source directory: A2Q1, A2Q2. You should create these directories in your userspace and download the .java source files to the appropriate directories. However, note that you need only submit one source file for Q1 and two source files for Q2, and these can all be submitted the same way: see detailed instructions below. You do not need to submit the files you do not change.

Do not change the package name at the top of each file: we depend on these when we compile and test your programs.

For each question, a test program is provided that will allow you to test your code. This test program does not exhaustively test all functionality: you should test your program on a wider range of conditions than specified in the test program. A different test program, typically testing a broader range of conditions, will be used to grade your assignment.

Your methods should be able to handle error conditions as specified, throwing the appropriate exceptions, which will be caught by our testing programs. This will be part of the evaluation.

Please note that to get full marks, your program must:

  1. Pass all test cases (produce the correct output and/or exceptions for each input)
  2. Have the correct asymptotic run time (if specified)

Question 1. Pair Sums (35 marks)

Question 2. Emergency Ward Triage (65 marks)

Submitting your Programming Assignments
All assignments will be submitted electronically using web submit.

Detailed Submission Instructions: