Refined Tax Category
This program refines tax categories into more detailed ranges.
Problem Statement
Write a Java program that categorizes taxpayers into refined categories based on income.
Source Code
| 1 | public class RefinedTaxCategory { |
| 2 | public static void main(String[] args) { |
| 3 | double income = 850000; |
| 4 | if(income <= 250000) { |
| 5 | System.out.println("Category: No Tax - Eduinq"); |
| 6 | } else if(income <= 500000) { |
| 7 | System.out.println("Category: Low Tax (5%) - Eduinq"); |
| 8 | } else if(income <= 750000) { |
| 9 | System.out.println("Category: Medium Tax (15%) - Eduinq"); |
| 10 | } else if(income <= 1000000) { |
| 11 | System.out.println("Category: High Tax (20%) - Eduinq"); |
| 12 | } else { |
| 13 | System.out.println("Category: Very High Tax (30%) - Eduinq"); |
| 14 | } |
| 15 | } |
| 16 | } |
Program Output
Category: High Tax (20%) - Eduinq
Explanation
The program uses an if-else ladder to refine tax categories into more detailed ranges. It starts with no tax for income up to 2.5 lakh, then gradually increases the tax category as income rises. This refined categorization allows more precise classification of taxpayers, reflecting real-world tax systems where multiple slabs exist. The ladder ensures only one condition executes, making the program efficient and accurate. Shows how refined tax categories can be implemented using if-else ladder.