Week 13 · 13.3 · Wed, Oct 28 · Do Now
Do Now
Work every question in your notebook. Do it on your Chromebook with your ID.
Find the wrong row
A student traced this code and made the table below. Which row is wrong first?
k ← 3 j ← k * 2 k ← j j ← j + k
The student's trace table line k j 1 3 2 3 6 3 6 6 4 6 9 - Line 1 row
- Line 2 row
- Line 3 row
- Line 4 row
Six lines, three boxes
Build the header row, then trace all six lines.
h ← 1 g ← h + 9 h ← g * 2 f ← h - g g ← f + h show g
Rows with shows
No line repeats. How many rows does this trace table need, not counting the header?
d ← 4 show d e ← d + 1 show e d ← e * d show d e ← 0
- 4
- 5
- 6
- 7
Build the whole table: seven lines
Seven lines, two shows. Build the whole table, then submit it to check.
a ← 3 b ← a * 4 c ← b - a show c a ← c + b b ← a - c show b