# Quizzes

### Policies

You will have 20 minutes to complete each quiz. If possible, we will distribute the quiz early, but you should not look at the questions until you are told to begin.

• To Bring: pencil, eraser
• Provided: printed quiz with white space for work, time keeping
• Not Allowed: note sheets, watch, hat, calculator, cell phone, or any other electronic device

### Topics

❗️New: From Quiz 2 onwards, we will ask you to memorize a few short code snippets before the quiz, and on the quiz we will ask you to re-write them exactly as written here. The goal is to help familiarize you with the syntax of Processing so that you are more comfortable writing code and can more quickly recognize syntax errors. The code snippets that you should memorize are given below. For these questions, we will place more weight on the correctness of your syntax, as opposed to your ability to remember the names of the variables and functions.
Quiz Date Topics Code Snippets To Memorize
Quiz 1 Jan 17
• Abstraction
• Lightbot
• Binary
• Processing: syntax, shapes, and colors
n/a
Quiz 2 Jan 31
• Variables & Data Types
• Functions
• Expressions & Control Flow

Cube Function

```float cube(float x) {
float result = x * x * x;
return result;
}```

if-statement

```if (a < 10) {
b = a + 4;
}```
Quiz 3 Feb 14
• Input/Output
• Loops
• Arrays
• Big Ideas: Data Visualization

Function return

```int value = pow(x, 3);
println(value);```

Using arrays

```int[] arr = new int[3;]
arr[2] = 7;
arr[0] = arr[2] + 1;```
Quiz 4 Feb 28
• Images
• Strings
• Big Ideas: Machine Learning, Security, Computers, HCI

Using strings

```String s = "Hello, ";
s = s + "world!";
println(s);```
Quiz 5 Due Mar 13 This will be an online course assessment worth 10 quiz points. The link will be posted soon. It must be completed by the end of Friday, Mar 13. n/a

### Practice

Below are sample questions from exams in past offerings of this course. Note that each quiz will only cover the topics listed above, so you may safely ignore questions that are outside of that scope.