Week 11
Python
Monday
Destructive Programming
- Colab notes: 2021-11-08.ipynb
- Configure Colab:
- Turn on the “show indentation guides” option in Colab and set the indentation width to 4 spaces.
- These options will make it easier to see the levels of indentation, which affect how Python interprets your code.
- (Click the gear icon in the upper right to open the settings pane)
Wednesday
Review and Promises for Midterm 2
- Logistics:
- 75 points / 75 minutes
- budget your time one point per minute
- designed the length with a 75-minute lecture in mind
- actually have 120 minutes for our lab, so time should not be an issue
- Reference notes (from the Exams section of the syllabus):
- you may refer to an 8.5×11-inch piece of paper, double-sided, with anything written (or typed) on it that you want.
- preparing this sheet of notes is an excellent way to study, encouraging you to consider what’s important that you will want to refer to.
- You are on your honor:
- due to five sections of the course taking their exam at different times on Friday
- we will ask you to attest that you have not discussed, and will not discuss, the contents of the exam with anyone until everyone has taken the exam.
- we will let you know as soon as all students have taken the exam
- Topics:
- While the exam is necessarily cumulative, the emphasis will be on topics we've covered since the first Midterm. You are generally responsible for the material in
- chapters 9, 10, 11, 13, and 14 of the DCIC text
- Ch. 9: Lists
- Ch. 10: Processing Lists
- Ch. 11: Structured Data
- Ch. 13: Recursive Data
- Ch. 14: Trees
- corresponding lectures from weeks 6, 7, and 9
- labs 5, 6, and 7
- assignments 4, 5, and 6
- Promises:
- 5 questions, points for each question will be indicated
- all Pyret, no Python
- sample questions shared as a PDF in Campuswire and provided as today's handout
- Problem 1. Step-by-step development of a non-recursive function that takes a list of numbers, and uses an anonymous function and a built-in list function in its body (like Problem 5 on the practice exam)
- Problem 2. Expressions involving built-in list functions. (like Problem 6 on the practice exam)
- Problem 3. Given a recursive data definition (like Problem 2–The Cat in the Hat–on the practice exam), make examples, write a template, and a function.
- Problem 4. List of structured data. (like Problem 4 from the practice exam)
- Problem 5. Given a data definition for a Tree, and the diagram of a tree (like Problem 7 on the practice exam):
- translate the tree diagram into its Pyret representation
- design a function that takes a Tree, including all the parts a function should contain.
Friday
- Midterm 2
- Come to your regular lab in SC 006 (Agile Computing Lab)