CS240 Spring 2024 Assignments

Skip to: Posted Assignments, Guidelines, Academic Integrity Declaration, Written Assignments, Logging in to Markus, Programming Questions, Viewing Marking Results, Creating PDF files


Throughout the term, there will be 5 written assignments and 2 programming questions. Written assignments must be submitted electronically through MarkUs, and programming assignments must be submitted electronically through Marmoset.

Make sure you read through all the assignment guidelines; we will have no leniency for students who fail to follow instructions.

The return policy and mark appeals policy for assignments and exams and marks information are outlined on the course info page.


Selected assignment solutions will be posted to the protected files area after the assignments have been collected. Always remember that solutions show only one way of solving the problems, which is not necessarily the only way or the best way.


Posted Assignments 

Assignment Release date (Tentative) Due date and time Assignment files Post-Mortem
Academic Integrity Declaration 1 (AID01)
    Monday, May 6
    Tuesday, May 14 at 5pm
Assignment 0
    Monday, May 6
    Tuesday, May 14 at 5pm
Assignment 1
    Wednesday, May 8
    Tuesday, May 21 at 5pm
Assignment 2
    Tuesday, May 21
    Tuesday, June 4 at 5pm
Programming Question 1 (PQ1)
    Tuesday, May 28
    Tuesday, June 11 at 5pm
Academic Integrity Declaration 2 (AID02)
    Tuesday, June 4
    Tuesday, June 18 at 5pm
Assignment 3
    Tuesday, June 4
    Tuesday, June 18 at 5pm

Midterm Exam

Tuesday, June 25, 4:30PM Tuesday, June 25, 6:20PM
Assignment 4
    Tuesday, June 25
    Tuesday, July 9 at 5pm
    Monday, July 15 at 8am with no grace period
Programming Question 2 (PQ2)
    Tuesday, July 2
    Tuesday, July 16 at 5pm
    Tuesday, July 30 at 5pm
Assignment 5
    Tuesday, July 9
    Tuesday, July 23 at 5pm

Final Exam

Tuesday August 6, 7:30PM Tuesday August 6, 10:00PM

** Assignment 0 is an easy way to add bonus marks to Assignment 1.

Guidelines 

No late assignments will be accepted. The exception is for assignments/questions which are submitted before the 11:59:00pm grace period on the due date. However, assignments or assignment components can be excused with appropriate verification of illness and the weight will be distributed over the other, non-excused assignments. Please contact the course ISC (Karen) if you need your assignment to be excused due to illness.

If you have the assignment done (or partially done) before the deadline, submit it---you can still change it before the deadline. Arguments such as "I thought the deadline was today, not 1+ days ago. I had it done on time." when there is nothing in MarkUs to prove that, will not be accepted.

Files submitted after the deadline can be marked for feedback if the ISAs are notified within 48 hours of the deadline to look for them to give feedback. (This is highly recommended to test your understanding of the material if you miss a deadline for whatever reason, including illness.)

Academic Integrity Declaration  

The solutions you hand in must be your own work. In particular, you are not allowed to look up the solutions in the literature or on the Internet. An academic integrity declaration will be required twice throughout the term (to be submitted to MarkUs); failure to submit this will result in a grade of 0 for the assignments associated with that declaration (A0-A2 and PQ1 for the first AID, A3-A5 and PQ2 for the second AID).

Written Assignments 

The following are general guidelines for how to write your solution; if the assignment specifies otherwise then follow what the assignment says.

For questions that ask you to design/describe/give an algorithm or a data structure, you should design the best algorithms you can come up with. The first criterion for marking is the correctness, the second criterion is efficiency. Thus, an algorithm that is too slow but correct has a much better chance for partial marks than an algorithm that is fast but incorrect. In your solution, enclose the following:

  1. describe the main idea first in words,
  2. present all the details (at a level of detail similar to the lecture notes), typically as clearly written pseudocode or as a well written English description,
  3. justify correctness (we do not require a full CS245-style proof, but explain briefly why the algorithm returns with the correct answer),
  4. analyze the algorithm (typically by giving a tight bound on the worst-case run-time, but you may also be asked to analyze auxiliary space or other types of run-time).

For assignments typically all four steps must be done, while for exams often only step (2) is required (exam-questions should clarify this, but ask if in doubt).

For questions that ask you to argue/prove a statement, you are expected to give a formal proof, demonstrating the series of steps which lead you to the answer. You must justify any "non-obvious facts" that you use in your proofs. (A "non-obvious fact" is any fact which has not been stated/proved in class. In the case that you are using facts stated in lectures/modules, be sure to cite where you got them from.) Be very hesitant to use phrases such as "Obviously...'', "It can be easily shown that....'', "It is clear that...'' because all too often it is not truly obvious (and sometimes it is simply not true). If you are asked to give a bound, then you should not only state what it is but also justify why it holds.

You can use any result that was proved in class or tutorials or in the course notes without proof. Typically you should not need mathematical results other than the ones from first-year math and CS courses. If you feel that some results from more advanced courses would really simplify the solution, contact the instructor to see whether you are permitted to use it without proof.

Ensure that your solutions are complete and mathematically precise, and at the same time, easy to understand and to the point. Be sure your arguments will convince a skeptical (but intelligent) TA. Your solutions will be judged not only for correctness, but also for quality of your presentation and explanations. If you have are aware that some part of the problem is left unsolved, say so. If in doubt, write down more details (while conciseness is appreciated by the TAs, overlength will rarely be punished). The course notes have numerous examples of how to describe an algorithm or do a proof; mimic their style.


How to submit assignments on MarkUs: Written work must be submitted through MarkUs using PDF files. LaTeX is strongly recommended but not required. Each question must have an individual PDF-file. For Assignment X and Question Y, the corresponding file should be named aXqY.pdf. The file names will be visible in MarkUs when you go to submit.

Submitted files should be reasonably small: less than 5,000KB (and preferably less than1,000KB). Files > 5,000KB should still be accepted by MarkUs, but may be difficult to handle for the graders.

Login:   To log in to MarkUs, please ensure that you are doing the following:

Programming Questions 

Programming work is to be submitted through Marmoset Your program should be implemented in C++ on the undergrad Linux environment linux.student.cs.uwaterloo.ca. Specifically, we will be translating it with c++ -std=c++17. If you are working on a different platform, it is your responsibility to ensure that your program runs properly on the undergrad environment. Files should be named .cpp, where the specific file name will be specified in the assignment. Skeleton code will sometimes be distributed.

References: Consulting C++ references (such as http://cplusplus.com) is acceptable, but do not copy more than single lines of code from the web or existing libraries. As for the standard library (STL), typically you are allowed to use functions/classes that have nothing to do with CS240 material and are extremely helpful (such as iostream and unique_ptr.) Usually you will also be allowed to material from predecessor courses, such as array, (forward) list, deque, queue, stack, iterator and pair. But you are not allowed to use functions/classes that implement CS240 material or otherwise simplify the assignment. In particular, do not use algorithms for sorting or searching, or containers such as vector, priority_queue (unordered) (multi)set, (multi)map. If in doubt, do not use it. As always, instructions on the assignment take precedence over the specifications given here.

Tips for coding your solution: Programming questions will usually involve implementing an algorithm or data structure that you have seen in class (or a variation of it). Sometimes details of how to realize parts of the algorithm/data structure are left out; it is then part of your assignment to figure out those details.

You should include sufficiently many comments in your code that the main ideas of design and correctness are clear. Marking will be primarily based on correctness (as determined by our test runs), but marks may also be assigned to the coding style (documentation, design, clarity, efficiency, no memory leaks, etc.).

Each assignment will specify the signatures of the methods that you must implement, and how they will be tested. Since we will compile/run/test your program using an automatic script, it is vital that you follow our instructions to the letter. It is part of your assignment to test your program thoroughly yourself (on your own input) to ensure its correctness. Good programming practice generally dictates that each class definition should appear in its own file, typically with a header file. For CS240, we will not ask you to do this, and you are specifically allowed to put multiple class-definitions into one file.

One-line changes: In the case you passed the public test, and failed some secret tests, if your program works with a one line change, then we may accept it for remarking and give some marks after deducting a penalty (typically 10-20% of the programming question). Contact the ISA if you feel that this may apply to you.

Viewing Assignment Marks

 

You can look at your assignment marks and graded assignment on MarkUs. Marks and feedback are released to students as soon as marking is completed and an announcement will be made. MarkUs will have the most up-to-date marking results for assignments.

To log into Markus, see Logging into Markus.

Once it has been announced that marking for an assignment is completed, you can see your mark for each assignment on your MarkUs home page. For a more detailed breakdown of your mark along with marker comments, click the "Results" link.

Creating PDF Files for Written Assignments

 

Electronic submissions require text or PDF files only. Your program files will already be text, without any intervention from you. However, non-programming answers will need to be submitted as PDF files. Here are some ways to create PDF files:

The following are least preferred methods since the results may be hard for markers to read and/or the files may be too large. Marks may be deducted for hard-to-read solutions (i.e. it takes extra time to figure out what is written).

Always check the file on MarkUs after you submit to make sure it is the right version of your answer and that it can be read clearly at a glance.

If getting a PDF of a diagram or hand-written answers to assignment questions will be a problem for you, please email cs240 [AT] uwaterloo [DOT] caas soon as possible (significantly in advance of the deadline).

Assignment Re-Mark Requests

We take great care to ensure that all marks are recorded properly in our database. Nevertheless, please ensure that your mark has been properly recorded by regularly checking your record in the grade lookup system. Any discrepancies should be reported immediately to the Instructional Support Assistant(s).

All assignment re-mark requests must be made within 1 week of the date of initial mark release. For assignment 5, re-mark requests are due before the final exam, if it is earlier than the two-week period. Please note that your marks may go up, down, or remain unchanged when you submit a re-mark request, to ensure that all marking conforms to the standards used to mark other students.

General Guidelines: Before submitting a re-mark request, please make sure that you have done the following:

Submitting a Re-Mark Request: Please email cs240 [AT] uwaterloo [DOT] cain order to submit a request. Please give the subject as "CS240 AX Re-Mark Request", where X is the appropriate assignment number. In the body of your email, please include the question number(s) that you would like us to take a look at, along with a clear explanation of why you feel these questions need to be re-marked.