Develop a class named TaxCalculator with a method named calculateTax with the following method parameters, Variable
Question:
Develop a class named "TaxCalculator" with a method named calculateTaxwith the following method parameters,
This method should return a double taxAmount. The business logic for calculating the tax is as follows, this has to be implemented inside the method, If the employee is not a Indian The calculator should throw a CountryNotValidException If the employee name is null or empty The calculator should throw a EmployeeNameInvalidException If empSal is greater than one lakh and isIndian true taxAmount =empSal *8/100 Otherwise If empSal is between 50K and 1lakh and isIndian true taxAmount =empSal *6/100 Otherwise If empSal is between 30 and 50 Thousand and isIndian true taxAmount =empSal *5/100 Otherwise If empSal is between 10 and 30 Thousand and isIndian true taxAmount =empSal *4/100 Otherwise The calculator should throw a TaxNotEligibleException. Develop a main class CalculatorSimulator, implement the following logic in main method
The following test cases to be executed, change the data in main method and run it and verify the output messages
|
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates