Header Contract Model
Challenge on lesson: Checkpoint: Multi-File Thinking
CHALLENGE
Difficulty: beginner+25 XP
Model a multi-file project in one file: implement int add(int, int) (the "math_utils.cpp" definition), a bool declared_only(int) that must exist so the "main.cpp" side links (declare-and-define pattern), and int call_add(int, int) which calls add through its declaration-style usage. Then fix the classic bug: kMaxRetries must be a shared constant usable from "several files" — define it correctly for a header.
Press Submit to check your solution.
Back to lesson: Checkpoint: Multi-File Thinking