Week 13 · 13.3 · Wed, Oct 28 · Do Now
Do Now
Work every question in your notebook.
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
- Line 2 row
- Line 3 row
- Line 4 row
- Line 1 row
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
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
- 6
- 7
- 5
- 4
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