Monday, February 9, 2015

Exceptions

Write a class with methods to calculate the Income tax for employees with below conditions:

1. Salary is greater than 3L to 5L, then the tax calculation is 2% of the amount exceeds 300000. (Eg: if salary is 350000, then calculate the tax for 350000 - 300000 = 50000 only)
2. If salary is more than 5L, then the tax amount is 3% of the amount exceeds 500000.

Try this with both try,catch and throws.

No comments:

Post a Comment