Tests

Midterm 3 is in Lab at Zybooks 9.18

Midterm 1 Topics

Here are the main topics we've covered so far this semester, along with the reference of where to do brush-up reading / experimenting about each one.

  1. Printing output and getting input (Zybooks 1.3)

  2. Variables, Valid identifiers, & Assignment (Zybooks 2.1 & 2.2)

  3. Mathematical operations: (Zybooks 2.5, 2.6, 2.7)

    1. Basics: plus (+), minus (-), divide (/), multiply (*),

    2. More: exponentiation (**), mod to get remainder (%), shortcut (e.g. +=), divide and truncate (//)

  4. Branching (if - elif - else), Indentation, and Logical operators ==, !=, <, >, <=, >= (Zybooks 4.2, 4.4)

    1. Nested if statements are the equivalent of using AND

    2. Two if statements one after the other are similar to using OR

  5. String formatting using f-strings (Zybooks 3.10)

  6. While loops (Zybooks 5.1, 5.2)

    1. Counting

    2. Use a variable to represent a logical condition

  7. Combining all the above to write programs. Examples:

    1. Prompt for a lower bound and an upper bound. Display all the numbers between those two.

    2. Prompt for a number. Sum all the values 1..30 except those numbers that are multiples of the input number.

  8. Microbits: (makecode.microbit.org/#editor)

    1. Basic blocks: On Startup, Forever, Pause

    2. Sensors: Light, Sound, Accelerometer, Compass, Temperature

    3. Displaying a block of LEDs, or plot / unplot a single LED at some x,y location

Midterm 1 Review Program

I've created an interactive set of review questions to help you study, illustrating the types of questions you will likely find on the lab and class midterm. As it is updated with more content I will notify you on Piazza so you can re-download it to include the new content. When you first open it, select the Question Set tab at the bottom of that window.

Using it looks like the following:

Read the instructions and type your answer in the gray box, and then press enter (or select Check Answer). In cell B7 the program will display either Correct or Incorrect.

  • Select Display Answer to reveal the expected answer.

  • Select Next to randomly choose another problem.

  • The program does exact text comparison. In your answers put single spaces around operators as shown in the sample at left.