Session 20 Preparation — Videos, Reading and Quizzes

Instructions:

There is no quiz associated with this preparation. But NOTE THE ITEM BELOW.

Videos and Reading:

Here are the main concepts that you can expect on Exam 3. For each concept, be sure that you can apply that concept to implement solutions to coding problems.

  1. The wait-until-event pattern and using while statements to implement that pattern.
  2. Sequences, including:
    • How to access the kth item in a sequence. How to access the first item in a sequence (indices start at 0, not 1). How to access the last item in a sequence using the len function.
    • The distinction between an index and the item at that index.
    • Using the three-argument form of a RANGE expression to loop through some or all of a sequence.
    • Using IF statements inside the loop to select items in the sequence that meet a given condition, accessing and/or setting those items.

    See Session 11 Preparation and Project and Session 12 Preparation and Project to review these concepts.

  3. Building up a sequence, using append (for lists) and the plus (+) operator for strings and tuples.
  4. The various patterns for looping through a sequence, including:
    • The FIND pattern for finding the first item in a sequence that meets a given condition.
    • The MAX/MIN pattern for finding the item in the sequence that is biggest (or smallest) per some given condition.
    • The two-places-at-once pattern wherein, at each iteration of the loop, the code accesses the sequence at more than one index.
    • The parallel-sequences pattern wherein the code loops through two sequences in parallel, examining index k of each sequence at each iteration of the loop.

    See Session 16 Preparation and Project to review these concepts.

  5. The distinction between two ways to send information back to a function/method's caller:
    • Returning a value and
    • mutating an argument that is a sequence (or other mutable object).

    See Session 16 Project to review these concepts.

  6. Loops within loops and sub-sequences of sequences, and how to figure out the loop structure in problems requiring:
    • printing on the console,
    • iterating through sub-sequences of sequences, and
    • drawing a two-dimensional figure using Rosegraphics.

    See Session 18 Preparation and Project and Session 19 Preparation and Project to review these concepts.

  7. Input from the Console
    • See Session 14 Project to review this concept.
  8. For the paper-and-pencil portion:
    • Box-and-pointer diagrams to solve problems in which some variables are mutated and others reassigned:
      • Without a function call, and
      • Within a function call.
    • Tracing loop-within-loop code by hand.
    • Tracing WHILE loop code by hand.
    • Judging what loop structure is required (no loops? one loop? a loop within a loop? etc)
    • Topics from previous paper-and-pencil exams, especially scope and lifetime of variables defined inside (and outside) a class definition.

    See the practice paper-and-pencil problems for Exam 3 for practice on the above.

Of course, you will also need to apply concepts from previous exams, but Exam 3 will strongly emphasize assessing concepts from the above list.