Practice · 1 of 4
ParseAge with layered validation
CHALLENGE
Difficulty: beginner+25 XP
Implement static int ParseAge(string input): null/whitespace → ArgumentException; not a number → FormatException; outside 0–150 → ArgumentOutOfRangeException; otherwise the parsed age.
Press Submit to check your solution.
Back to lesson: Practice: Error handling workout