Question: Write a small piece of code asking for a year value. Using exception handling, throw an exception if the entered year is greater than 2003
Write a small piece of code asking for a year value. Using exception handling, throw an exception if the entered year is greater than 2003 and provide the appropriate exception handler that contains a statement to print a message and exit the program. In case the year is less than 18 display the following message"Apropriate age to enter the club".
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
