HW4 (due Sat. 23-Sep, 8pm)
From the syllabus:
Homework assignments will be primarily completed on the
CMU CS Academy website with few exceptions. These assignments will include code tracing exercises and free response exercises requiring writing code, which are all generally autograded. The homework allows you to get practice on solving problems in an untimed environment with unlimited tries to automatically check solutions in CS Academy. The lowest two homework grades will be half-weighted.
Homeworks are
entirely solo unless the assignment very explicitly allows you to collaborate. See the "Academic Integrity" section below for more details. That said, you always have access to extensive help provided by the TAs and course faculty. To get help on the homework assignments, you can go to daily office hours and/or post questions to Piazza.
A green checkmark next to a problem 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:
- Each CS Academy assignment will show required "stars" in exercise sections, listed like this:
"Section Exercises: ⭐ 0 / 0."
Ignore these numbers. For this class they have no meaning. You must complete the problems described below.
- Do not hardcode to the test cases in your solutions.
- We will not grade your code for style this week.
- Do not use lists, list indexing, or recursion this week.
Each problem listed below is required. The point values they are worth are shown here in parentheses like this: (2). Except for Required Task 1, they are the same points values shown in CS Academy.
Total points: 15
- Required Task 1: Installing VS Code and Python 3.11 (worth 1 star)
- Carefully read and follow the instructions here to install both Visual Studio Code (VS Code) and Python 3.11
- Download this python file (helloWorld.py) and modify it in VS Code so that it prints your name and andrewID, similar to the screenshot below.
- Run the file (using ctrl-B or cmd-B as noted in the VS Code installation instructions). Your output in the terminal should look similar to the screenshot below. If you encounter any issues, ask on Piazza or in Office Hours.
- Once you are able to successfully modify and run the file, capture a screenshot of your entire screen (which should look similar to the image below) and upload it using this form. You will earn the star for this step if your screenshot demonstrates to us that you have VS Code and Python 3.11 installed.
- Notes for Task 1
- It may be possible to use a different environment in the future, but this week you must use VS Code and follow the instructions above. (Small differences in setup like light mode vs dark mode, font size, etc. are fine.)
- We recommend always running your code with ctrl-B (Windows) or cmd-B (Mac). The green "run button" looks enticing but may not run your code properly.
- General reminder: It is your responsibility to ensure that any required 112 forms are properly submitted! If you don't see a confirmation email shortly after submitting any 112 form, that form is not submitted. Save the emails in case you need them later. The Task 1 form is due at the standard homework deadline (8pm Saturday). Note that we will manually review Task 1 screenshots after the deadline and before awarding points, so you should make sure that the screenshot shows the information listed above in order to maximize your chances of getting the points. You may edit your form responses before the deadline, but we will not award points for submissions after the deadline has passed, nor will we award points for screenshots 'submitted' through any other means (i.e. Piazza or email).
- Unit 3: Animations
All exercises below should still be completed in CS Academy! You cannot paste code into these exercises, so do not attempt to write them in VS Code or you will have to waste time manually re-typing them, and without version history it will be harder for you to verify that your work is your own. In the future, some exercises will be completed in VS Code only, but not this week.
Also, remember to read the autograding tips for graphics here!
- 3.2.4 Guided Exercises:
- 3.2.5 Section Exercises:
- 3.3.6 Guided Exercises:
- 3.3.7 Section Exercises:
- 3.4.3 Guided Exercises:
- Moving Highlighting Dot (1)
- 3.4.4 Section Exercises:
- 3.6.2 Guided Exercises:
- 3.10 Unit 3 Guided Exercises:
- 3.11 Unit 3 Exercises: