HW8 (due Sat. 18-Mar, 8pm)


From the syllabus: Each CS Academy assignment has a required number of "stars" in several sections, listed like this:
    "Section Exercises:   ⭐ 0 / 11."
Unless otherwise specified, each star is worth the same percentage of your homework score, up to 100%. If you complete fewer than the required number of stars in a section, you will receive a score equal to the percentage of required stars you completed. For example, if there are 16 required stars and you complete 8, you will receive 50%. If you complete all of the required stars you will receive 100% on the assignment. Each star you complete over the required number for that section is worth 0.5 percentage points of bonus on the assignment. Thus, if there are 16 required stars and you complete 19, you will receive a 101.5% on the assignment. Unless otherwise specified, bonus points cannot bring your score above a 105% per assignment. Stars from CTs are ineligible for bonus points.

A green checkmark next to a problem (in CS Academy) means it has autograded correctly and you are done. No green checkmark means it's not done yet. If you believe you should have received a green checkmark, be sure to review your work, and be sure that you hit the "check" button after the "run" button to submit it. The "check" button runs your code against additional hidden test cases which you must pass in order to receive credit. It's your responsibility to properly submit and be aware of whether you have received green-checkmark credit for your work! There is generally no partial credit for autograded problems.
Important Notes:
  1. Aside from problems we fully solve in lecture or recitation, homework is fully solo. You must not collaborate with anyone (besides current course TA's and faculty) in any way. See the syllabus for more details.
  2. Do not hardcode to the test cases in your solutions.
  3. As for exercises marked with :
    • We plan to cover these in lecture or recitation. You may take notes, and it is fine if your solution looks like ours, but we strongly discourage you from simply copying what we type. Instead, take notes on the approach and try to recreate the solution yourself.
    • For the best learning experience, we recommend that you do not attempt these exercises before we cover them in lecture or recitation.
    • The problems with checkmarks are somewhat subject to change and lecture timing. Sometimes we may cover one or two more, or we may change which one we cover, but we will try not to.
  4. Do not use recursion on these homework problems. Also note that you must meaningfully use sets in the set exercises and dictionaries in the dictionary exercises, and you must adhere to any additional requirements in the problem statement, even if you find a solution that passes the autograder without them. In addition to style grading, we may manually check your work, and you will not receive credit if your solution passes the autograder but does not adhere to problem requirements (such as efficiency requirements, or use of sets and/or dictionaries, etc).
  5. Also note that certain exercises mention that you may not create new lists, but they require you to return a new list. This is somewhat misleading/contractictory, so to clarify, you may return a new list, but you should not assign a new list to a variable. For example, you might return sorted(s) where s is some set. This returns a sorted list of the elements in s.

Additional required tasks: 2/2 ⭐ required

This week you will need to complete the following task before the homework due date, worth 2 required stars on this assignment. We will release additional details here no later than Wednesday. Updated on 3/14 at 11:15pm!

  1. It's time for you to begin moving out of CS Academy! Download and install Python 3.10 and VS Code as described here, if you have not already. You must also install the offline cmu graphics package as described in this Piazza post.
  2. Next, download the hw8_makeBorderish.py starter file here and open it in VS Code.
  3. In the starter file, complete makeBorderish(L) from midterm1. (You can find the problem statement for makeBorderish(L) in midterm1, which is linked from the course schedule). Run your code and make sure it passes the test cases. (Note: It is ok if you have previously viewed the midterm solution session and if your solution is similar, but you must write your solution without referencing or copying any existing code or collaborating with anyone aside from current TAs, to ensure that you know how to solve this problem by yourself.)
  4. If makeBorderish passes the test cases, the starter file will then attempt to run an animation. You don't need to change any of the code in the animation; as long as you see a bouncing green box with text, this confirms that you've successfully installed cmu_graphics.
  5. Once your completed starter file runs, passes the test cases, and successfully dsiplays the animation, you must submit it to Autolab in order to receive credit. Look for the hw8_makeBorderish assignment under the etc category. Click the assignment and add your file to the submission box, confirm that you've adhered to the academic integrity policy, and press submit. You'll be taken to another page where you'll eventually get your autograded feedback, but it won't show up right away. Wait about one minute and then refresh the page. If you see a 100, you're good to go. Otherwise, click that number to get your autograded feedback on what test case didn't pass.
  6. If you have not completed the above steps (including submission to Autolab) by Friday morning at 9am, you are required to attend your Friday recitation time this week for assistance (and of course you can also use Piazza and OH for help prior to that).
  7. Lastly, here are a few more important notes:
    • You may only submit to Autolab up to 5 times! This is so that you make sure you're passing the local test cases in the starter file before you submit, rather than simply throwing code at Autolab without testing it. If you aren't sure how to interpret the feedback you're getting in the starter file or in Autolab, post on Piazza.
    • Outside of CS Academy, assert statements will NOT tell you what your function is returning; they'll simply crash and tell you that the assert did not pass. Use print statements to debug!
    • Remember to run your code in VS Code using ctrl-b on windows or cmd-b on macs. The triangle button in the upper-right corner is enticing, but it may run your code in a way that causes it to crash. Use the keyboard shortcuts instead!

In CS Academy, complete the required number of stars from each section below.
For each section, we list the number of required and available stars. For example, this means 2 out of 4 stars are required from a section: "2/4 ⭐ required"
The number of stars available for each problem is in parentheses. For example, this means you get 2 stars for solving a problem: "(2)"


>>( o u o )<<