Exam 3

Overview of topics

Any topic covered during class since the beginning of the semester may be on the exam (e.g., strings, lists, dictionaries, loops, etc.). These data structures and operations are fundamental to be able to continue with the advanced topics we have discussed since the last exam. However, the main emphasis of the exam will be on recent topics from ch 5, 6, and 10, including:

I suggest you review chapters 5, 6, & 10 from our book, and recent reading quizzes. Our book, homework, and all in-class activities give you many examples that you can work through to practice.

Instructions

Instructions are the same as previous exam. The exam will be conducted in-person during class over the period of two class sessions. It is closed book, no calculators. You will have the duration of class time to finish the exam. It must be completed individually.

Bring your laptop and a charger. You are responsible for ensuring your laptop is properly charged on the day of the exam. You may bring a single one-sided letter-sized sheet of handwritten notes. I suggest you write sparingly on the single note page that you may use, and continue to study vigorously for the exam. You will not have enough time to complete the exam if you rely too heavily on your single sheet of handwritten notes.

Exam 3 - Part A: Moodle Questions (70%)

You will be a spare sheet of paper that has the academic integrity pledge. Print your name at the top. When you are finished with the exam, you will hand in this paper with the time the exam was submitted and show me (or a TA/ZI) on your laptop that your Moodle quiz has been submitted.

You will open Moodle in class. Moodle is the ONLY program that can be running; no other tabs in your browser, no plug-ins nor browser extensions, no Thonny, nor any other application. Moodle must be the ONLY tab open. Keep your eyes on your laptop only. Any violation of these expectations, such as if any other program or tab is opened except for Moodle, it is grounds for an immediate F on the exam.

Navigate on Moodle to “Exam 3 - Part A”. In class, I will give you the password to open the exam. Some problems are worth more points depending on their level of difficulty and number of subproblems; you can see how many points a question is worth in Moodle on the left side. Review your answers before you submit. Questions have the following form.

Exam 3 - Part B: Thonny Program (30%)

You will be a spare sheet of paper that has the academic integrity pledge. Print your name at the top. When you are finished with the exam, you will hand in this paper and show me on your laptop that your python file has been submitted.

You will open Moodle and Thonny in class. These are the ONLY programs that can be running; no other tabs in your browser, no plug-ins nor browser extensions, no Thonny, nor any other application. Keep your eyes on your laptop only. Any violation of these expectations, such as if any other program is opened, it is grounds for an immediate F on the exam.

There are roughly ~4 programming problems to solve. It is expected that your code will not have any syntax errors, and will follow the implementation instructions. Questions will have the following form to implement a function with provided instructions, input, and expected output. For example:

  1. Write code that creates a new 300 by 300 pixel image with white pixels and a 100 by 100 pixel green square in the center. Dsiplay it on a window, then save the image to a file called “img.gif”.

  2. Write code that will keep asking the user to enter in a number. Once the user enters in a negative number, it should terminate and print the sum of all positive numbers entered. For example, if the user enters 1, 2, 3, and -1, then the program will output 6. Do not use the keyword break.