OOP Studio Ages 9-15
Polymorphism Challenge
Repair three activate() overrides, then run one command through an enchanted room.
Mission
Match each room object with the behavior its activate() method should perform.
Important
The loop may only call object.activate(). Do not add type-checking if statements.
Proof
Correct overrides produce three different animations and sounds from one method name.
What should each activate() method do?



let roomObjects = [door, chest, trap];
for (let object of roomObjects) {
object.activate();
}
One command. Three object behaviors.




Room loop ready
Repair all three overrides, then activate the room.
Polymorphism challenge complete!
The unchanged loop activated a Door, Treasure Chest, and Trap without checking their types.
Completed! Next Lesson