========================= Practice problems: Exam 2 ========================= This set of practice problems will allow you to test your understanding of some the material we have covered this quarter. While these problems will be good practice for Exam #2, we do not promise that they cover the full range of topics that might appear on the exam. To get started run ``git pull upstream master``, which will pick up a directory named ``pp6``. As usual, the problems are broken up into two parts: a set of "be-a-computer" warm-up exercises and a set of programming problems. For the programming problems, we provide the code that handles the input/output of the problem. *Make sure you read the comments in the provided code so you understand exactly what part of the code you need to modify.* Warm-up exercise #1: What is the output of the following code? .. literalinclude:: warmup.py :lines: 3-11 Warm-up exercise #2: What is the output of the following code? .. literalinclude:: warmup.py :lines: 14-33 Warm-up exercise #3: What is the output of the following code? .. literalinclude:: warmup.py :lines: 36-50 Warm-up exercise #4: What is the output of the following code? .. literalinclude:: warmup.py :lines: 54-60 Warm-up exercise #5: What is the output of the following code? .. literalinclude:: warmup.py :lines: 64-74 The following programming problems are on the Kattis site. If you have not already done so, please make sure you have read our `Using Kattis <../../kattis.html>`_ page, which explains certain aspects of solving problems on Kattis. Programming problem #1: `Black Friday `_ Programming problem #2: `Ferry Loading 4 `_ Programming problem #3: `Permutation Encryption `_ Programming problem #4: `Torn to Pieces `_ This question is challenging. We recommend writing two functions: one that computes a dictionary that maps a station to a list of the stations to which it is directly connected and another that looks for a path between two stations. Programming problem #5: `Shortest Manhattan Distance `_. This problem is from a previous CS 121 exam. Programming problem #6: `It’s All About the Miles `_. This problem is also from a previous CS 121 exam.