CS240 Winter 2023 Assignments

Skip to: Posted Assignments, Guidelines, Academic Integrity Declaration, Written Assignments, Programming Questions, Logging Into MarkUs, Submitting Into MarkUs, Submitting Into Marmoset, 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.


(This is a web page for CS 240 Regular.)

Posted Assignments 

Assignment Release date Due date and time Assignment files Post-Mortem Average
Academic Integrity Declaration 1 Wednesday, January 11 Wednesday, January 18 @ 5:00pm
Assignment 0** Wednesday, January 11 Wednesday, January 18 @ 5:00pm
Assignment 1 Wednesday, January 11 Wednesday, January 25 @ 5:00pm
Assignment 2 Wednesday, January 25 Wednesday, February 8 @ 5:00pm
Wednesday, February 15 @ 5:00pm
Programming Question 1 (PQ1) Wednesday, January 25 Wednesday, February 15 @ 5:00pm
Wednesday, February 8 @ 5:00pm
Academic Integrity Declaration 2 Wednesday, February 15 Wednesday, March 1 @ 5:00pm
Assignment 3 Wednesday, February 15 Wednesday, March 8 @ 5:00pm
Assignment 4 Wednesday, March 8 Wednesday, March 22 @ 5:00pm
Programming Question 2 (PQ2) Wednesday, March 8 Wednesday, March 29 @ 5:00pm
Assignment 5 Wednesday, March 22 Wednesday, April 5 @ 5:00pm

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

Errata

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 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 

Written work must be submitted through MarkUs as a pdf file. See more instructions below. LaTeX is strongly recommended but not required.

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.

Programming Questions 

Programming work is to be submitted through Marmoset (see more instructions below). Your program should be implemented in C++ on the undergrad Linux environment ubuntu.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.

Submitting Written Assignments on MarkUs 

Written assignments are submitted electronically using MarkUs, a web-based submission and marking system.


MarkUs: Logging In 

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

If you encounter a "Login Failed" message, check that you meet the above three criteria before contacting course personnel. If you are still experiencing issues or have run into different errors (such as a redirect problem), please e-mail the course account with your Quest userid and a brief description of your error.


MarkUs: Submitting Assignments 

To submit files for Assignments, follow the instructions below.

  1. On your MarkUs homepage, click the assignment name to go to its submission page.
    Submissions
    This box shows you how many files you have submitted and how many of the required files you are missing. The Missing Required Files will initially be equal to the number of files you have to submit. As you submit the properly named files, this number will decrease. NOTE: For CS 240 assignment written components, you are required to submit pdfs for individual questions. Our required files in MarkUs reflect the requirements.
    Assignment Rules
    This box has the assignment name, due date, and the names of the required files for the assignment. You must name your assignment files for submission as indicated by the list, matching lowercase and uppercase letters before continuing with submitting.
  2. Click the "Submissions" tab at the top of the page.
  3. Click "Add A New File". A new row will be added to the table. Click "Choose File" or "Submit" in the new row. (The button's name will depend on your web browser.) In the window that appears, browse to where you have saved your file and select it. Click the Submit button.
  4. Your submitted file will now appear in the table. Check that the filename is correct. If you click on the filename, you will see the contents of the file. You should check that the contents are correct, and that you have submitted what you wanted to submit.

MarkUs: Replacing a file You can only replace a file with one that has the same name.
Warning Do not use Internet Explorer to replace files. It will appear as though the change has gone through when it has not. Your files will not be replaced.

MarkUs: Deleting a file If you have submitted the incorrect file, you can delete it by selecting the "Delete" box for the file and then clicking Submit.

Do NOT replace files by deleting and re-submitting them. If you want to submit a new version of your work, use the "Replace" column.

Submitting Programming Assignments Using Marmoset

 

Marmoset: Basic Logistics

  1. Go to https://marmoset.student.cs.uwaterloo.ca/ and log in using your WatIAM info. This should be the same as the info you use to log in to Quest.
  2. Click the "as" button under "Authenticate". You should have only one choice here.
  3. Click "CS240 (Winter 2023):".

    Note: If you don't see what you're supposed to see in steps 2 or 3, then you are probably not yet added as a student to CS 240 on Marmoset. Contact the course staff to resolve this issue.

  4. You should now be able to see the assignments that have been set up on Marmoset for CS 240. You can submit your assignment files to Marmoset via the "web submission" column for each assignment question.

Marmoset: Submitting Assignments

If only one file is required for an assignment question, you can submit only that file. If multiple files are required for an assignment question, you must zip all of the required files and submit the zip file. Make sure that all of the required files are named correctly; otherwise, you will receive "did not compile" error message.


Tests on Marmoset

There are two types of tests that we will use on Marmoset in CS 240: public tests and secret tests.

Public tests are designed to test whether your program works in the most basic sense possible. They are simple tests that test for trivial cases.

Secret tests are designed to test whether your program is correct. You can expect these tests to test all the dark corners and special cases that can potentially break your code.


After Submitting a Program

When you make a submission to an assignment question on Marmoset, your submission will be automatically tested on a CSCF server. After a while (a few seconds to a few minutes, depending on the state of the server, the program and test complexity), the tests should finish and a result will be available.


Marmoset: Interpreting Test Results

If your submitted program does not compile or run successfully on its own, your submission will receive a result of "did not compile" and the detailed test results will contain something similar to the error message you get if you ran your program yourself. In this case, your submission will not be tested with any of the tests.

If your submitted program runs successfully on its own, it will be tested with all of the public tests.

If it fails any public test, the detailed test results will display an error message for that public test.

Your submission with the highest score (ties broken by latest submission time) will be marked. After marking, if you wish to have a different submission marked instead, please submit a remark request.

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.


MarkUs: Viewing Assignment Marks and Results

Once marking for an assignment is completed (an announcement will be posted), 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 (Non-Programming) Questions

 

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.

File names for pdf submissions: You should submit one pdf file per question for all written solutions for an assignment. The file name format required is given in the assignment and will be visible in MarkUs when you go to submit.


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 to view in MarkUs -- so make sure they are as clear as possible and the files are <5,000KB (preferably <1,000KB). Files > 5,000KB will still be accepted by MarkUs, but we prefer that you keep your files small and not greater than 5000KB if possible, and 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 diagram or "hand-written" answers to assignment questions will be a problem for you, please email cs240 [at] uwaterloo.ca as soon as possible (and not just before a deadline).