Here's your approach for input validation:
Write a validate function that checks multiple conditions.
Throw invalid_argument if format is wrong.
Throw out_of_range if value exceeds limits.
Return normally if all checks pass.
In main, wrap validation in a try block.
Add catch blocks in order: out_of_range first, then invalid_argument, then exception as fallback.
Each catch handles its error type differently, providing appropriate feedback.