diff --git a/Calculators/IT-Income-Tax-Calculator/README.md b/Calculators/IT-Income-Tax-Calculator/README.md new file mode 100644 index 000000000..d15da7710 --- /dev/null +++ b/Calculators/IT-Income-Tax-Calculator/README.md @@ -0,0 +1,15 @@ +#

IT Income Tax Calculator

+ +## Description :- + +This calculator helps you compute your income tax based on your gross salary, deductions, and applicable tax rebate. + +## Tech Stacks :- + +- HTML +- CSS +- JavaScript + +## Screenshots :- + +![image](https://github.com/user-attachments/assets/b6d6b5e0-3750-4850-87d3-0ada77179dc2) diff --git a/Calculators/IT-Income-Tax-Calculator/index.html b/Calculators/IT-Income-Tax-Calculator/index.html new file mode 100644 index 000000000..6c25d8c44 --- /dev/null +++ b/Calculators/IT-Income-Tax-Calculator/index.html @@ -0,0 +1,47 @@ + + + + + + + IT Income Tax Calculator + + +
+

Instructions

+

+ Use this calculator to estimate your income tax. Enter your gross salary, deductions, and tax rebate, then click "Calculate Tax". +

+ +
+ +
+

Income Tax Calculator

+
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+
+ + + + diff --git a/Calculators/IT-Income-Tax-Calculator/script.js b/Calculators/IT-Income-Tax-Calculator/script.js new file mode 100644 index 000000000..8892fbb41 --- /dev/null +++ b/Calculators/IT-Income-Tax-Calculator/script.js @@ -0,0 +1,56 @@ +function calculateTax() { + const grossSalary = parseFloat(document.getElementById('gross-salary').value); + const deductions = parseFloat(document.getElementById('deductions').value); + const taxRebate = parseFloat(document.getElementById('tax-rebate').value); + + // Input validation + if (isNaN(grossSalary) || isNaN(deductions) || isNaN(taxRebate)) { + document.getElementById('result').innerText = 'Please enter valid numbers in all fields.'; + return; + } + + // Validate gross salary + if (grossSalary <= 0) { + document.getElementById('result').innerText = 'Gross Salary must be greater than 0.'; + return; + } + + // Validate deductions + if (deductions < 0) { + document.getElementById('result').innerText = 'Deductions cannot be negative.'; + return; + } + + // Validate tax rebate + if (taxRebate < 0) { + document.getElementById('result').innerText = 'Tax Rebate cannot be negative.'; + return; + } + + // Calculate taxable income + let taxableIncome = grossSalary - deductions; + if (taxableIncome < 0) { + taxableIncome = 0; // Ensure taxable income does not go negative + } + + // Calculate tax based on slabs + let tax; + if (taxableIncome <= 250000) { + tax = 0; + } else if (taxableIncome <= 500000) { + tax = (taxableIncome - 250000) * 0.05; + } else if (taxableIncome <= 1000000) { + tax = 12500 + (taxableIncome - 500000) * 0.2; + } else { + tax = 112500 + (taxableIncome - 1000000) * 0.3; + } + + // Calculate total tax after applying rebate + let totalTax = tax - taxRebate; + if (totalTax < 0) { + totalTax = 0; // Ensure total tax does not go negative + } + + // Display the result + document.getElementById('result').innerText = `Total Tax: ₹${totalTax.toFixed(2)}`; +} diff --git a/Calculators/IT-Income-Tax-Calculator/style.css b/Calculators/IT-Income-Tax-Calculator/style.css new file mode 100644 index 000000000..81cc69f19 --- /dev/null +++ b/Calculators/IT-Income-Tax-Calculator/style.css @@ -0,0 +1,92 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background: linear-gradient(to bottom right, #5a88ca, #8a4db2); /* Example gradient background */ + display: flex; + flex-direction: column; + align-items: center; + justify-content: flex-start; + min-height: 100vh; + overflow-x: hidden; +} + +.instructions { + background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */ + padding: 20px; + border-radius: 8px; + width: 350px; /* Same width as .container */ + text-align: left; /* Left align text */ + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Shadow effect */ + margin-bottom: 20px; +} + +.instructions h2 { + margin-top: 0; + font-size: 18px; +} + +.instructions p { + margin: 0 0 10px 0; /* Adjust margins for spacing */ + font-size: 14px; + color: #333; +} + +.instructions ul { + margin-top: 10px; /* Adjust top margin for spacing */ + padding-left: 20px; /* Indent list items */ +} + +.instructions li { + font-size: 14px; /* Adjust font size for consistency */ + margin-bottom: 8px; /* Adjust bottom margin for spacing */ +} + +.container { + background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */ + padding: 20px; + border-radius: 8px; + text-align: center; + width: 350px; /* Adjusted width */ + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Shadow effect */ +} + +h1 { + margin-bottom: 20px; + font-size: 24px; /* Increase font size for heading */ +} + +.form-group { + margin-bottom: 15px; + text-align: left; /* Left align form labels */ +} + +label { + display: block; + margin-bottom: 5px; +} + +input[type="number"] { + width: calc(100% - 20px); /* Adjust input width */ + padding: 8px; + box-sizing: border-box; +} + +button { + padding: 10px 15px; + background-color: #007bff; /* Blue button */ + color: white; + border: none; + border-radius: 5px; + cursor: pointer; +} + +button:hover { + background-color: #0056b3; /* Darker blue on hover */ +} + +.output { + margin-top: 20px; + font-size: 18px; + white-space: pre-wrap; /* Preserve line breaks */ +} diff --git a/index.html b/index.html index 2cfda4493..e4c59d7bb 100644 --- a/index.html +++ b/index.html @@ -2521,6 +2521,20 @@

Calculates the spread of the middle 50% of a dataset using the interquartile +
+
+

IT Income Tax Calculator

+

Computes the income tax based on your gross salary, deductions, and applicable tax rebate.

+ +
+

Ideal Gas Law Calculator