Week 5

Ch. 8: Processing Tables with Nested Functions

  • Announcement:
    • Coaching Hours posted!
    • I'm grading assignments (available soon in Gradescope)

  • Reminders:
    • Check Campuswire regularly for important and timely class announcements, like coaching hours

    • Lab 4:
      • as of Sunday night, only 20/40 submissions in Gradescope…
      • if you're still finishing up / need to be checked off, please see me during office hours (or see one of our coaches)
      • no late penalty, but please finish ASAP (no later than this Thursday)

    • Assignment 3: due this Thursday evening, 11:59pm

    • Exam 1 Reminders:
      • This Friday: October 1st, during lab
      • Review: Wednesday

  • Processing Tables
    • Marc's notes:
      • updated to include nested functions (this is not in Ch. 8, but it is a powerful technique)
      • viewable/runnable in CPO

Review and Promises for Midterm

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

    • You are generally responsible for the material in
      • chapters 1 through 8 of the DCIC text
      • lectures
      • labs 1–4
      • assignments 1–3

  • Promises:

    • 6 questions, points for each question will be indicated
    • sample questions shared in CPO here

    • Problem 1 (15 points) Pyret expressions. Given a series of Pyret expressions, indicate either what each expression evaluates to, or whether it results in an error. Expressions may involve:
      • values of type Number, String, Boolean (no Image values)
      • functions that take and return those types of values
      • operations/operators over those types of values
      • parenthesized expressions
      • named values of the form NAME = EXPRESSION
      • if-else, and if-else if-else expressions

    • Problem 2 (10 points) Fixing a function. Given a function with problems, identify and fix the problems.
      • identifying the problems may involve carefully reading the function header, docstring, examples, and body of the function
      • if the body and/or tests don't match the behavior described in the docstring, fix whatever is wrong so they do

    • Problem 3 (10 points) Incomplete function: missing examples in where: clause.
      • fill in missing examples–enough to fully test the function

    • Problem 4 (10 points) Incomplete function: missing body.
      • this time you are given the where“ clause for a function, but the rest of the function is missing!
      • fill in the missing function header, docstring, and function body

    • Problem 5 (10 points) Reading and understanding code. Given a function:
      • indicate which tests pass or fail
      • briefly describe (in words, not code) what you would need to change to make all of the tests pass

    • Problem 6 (20 points) Table Processing. Multi-part question. Given a table, and a function that takes a row from the table:
      • a. (2 points) fill in the expected return values in the where clause of the function
      • b. (3 points) write the docstring for the function
      • c. (4 points) write an expression to access the value in a particular row and column of the table
      • d. (6 points) write an expression that involves some form of table processing to compute/locate a particular value within the table
      • e. (6 points) given a table expression, show the resulting table
      • f. (8 points) write a predicate function that takes a row of the table and determines whether that row satisfies (returns true) the given criteria.
  • Midterm 1
  • In SC 006 Agile Computing Lab
  • At your section's usual lab time:
    • Section 04: 9am-11am
    • Section 05: 11am-1pm