Checkpoint: shape dispatch
Challenge on lesson: Checkpoint: shape dispatch
CHALLENGE
Difficulty: intermediate+25 XP
Complete int totalArea(Shape[] shapes): sum every shape's area() via dispatch and round DOWN to an int. Square chains through Rect. One loop, one accumulator, zero instanceof — dispatch does the branching.
Press Submit to check your solution.
Back to lesson: Checkpoint: shape dispatch