Skip to main content

Practice · 2 of 2

enum class Priority weights

CHALLENGE
Difficulty: intermediate+25 XP

Define enum class Priority { Low, Normal, High, Critical } and implement int priority_weight(Priority) returning 0, 1, 5, 20 respectively. Use an exhaustive switch (no default case) so a future enumerator fails compilation.

Back to lesson: Practice: optional and enum practice