Week 13 · 13.5 · Fri, Oct 30 · Do Now
Do Now
Work every question in your notebook.
Trace these lines. What do the boxes hold after line 3?
n ← 17 b ← n rem 3 ≠ 2 c ← n ≥ 17
- n = 17, b = true, c = true
- n = 17, b = false, c = false
- n = 17, b = 2, c = true
- n = 17, b = false, c = true
What is shown? The first line shown is first.
y ← 10 show y > 4 and y < 10 show y > 4 or y < 10
- false, then false
- true, then false
- true, then true
- false, then true
A student traced these lines and wrote that pass holds true. The right answer is false. What mistake did the student make?
score ← 70 pass ← score > 70 and score ≤ 100
- The student used the wrong value of score.
- The student forgot that 70 ≤ 100 is false.
- The student read ≤ as <.
- The student read > as ≥, but 70 is not greater than 70.
Which question is true exactly when n is even?
- n ÷ 2 = 0
- n rem 2 = 2
- n rem 2 ≠ 0
- n rem 2 = 0
Trace these lines. Write exactly what is shown, one line for each show.
n ← 36 even ← n rem 2 = 0 small ← n < 50 show even and small show not small