Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint: the reading log

โญ beginnerโณ 25 min read๐Ÿ“ Lesson 76 of 256

Object state + aggregation + the empty-input guard, in one class.

The pattern: a tiny class that accumulates state (total, count) and serves a derived statistic. Two contracts tested: the empty case MUST return 0, not crash, and the average truncates (integer division). "What is the state after this sequence?" is answered by your own trace table โ€” build it, then code it.