A good answer might be:The stack trace shows the situation:
|
Throwing an ExceptionYour program can throw an exception when it detects a problem situation. The problem can be one that is unique to the program's application. For example, say a program for an insurance company calculates a person's age by subtracting their birthyear from the current year 2000, and then calculates the number of years they have been driving by subtracting 16 from their age. People who have been driving less than 4 years get charged $1000 a year for insurance, otherwise $600. If a person's age is less than 16 they should not need insurance, so an exception is thrown.
The |
QUESTION 11:(Software Design Question: ) Do you think this is a well designed program? Click Here after you have answered the question |