diff --git a/Calculators/Lease-calculator/README.md b/Calculators/Lease-calculator/README.md new file mode 100644 index 000000000..a7eb5bd12 --- /dev/null +++ b/Calculators/Lease-calculator/README.md @@ -0,0 +1,15 @@ +# Lease Calculator + +A simple and intuitive lease calculator that helps users determine their monthly lease payments, total payments, and total interest. Designed to be responsive and interactive, this calculator provides accurate financial calculations with a user-friendly interface. + +## Features + +1. **Responsive Design**: + - Adapts seamlessly to all devices, ensuring a consistent user experience on desktops, tablets, and mobile phones. + +2. **Dynamic Calculations**: + - Instantly computes and displays monthly lease payments, total payments, and total interest using precise financial formulas. + +3. **Interactive Elements**: + - Incorporates hover effects and smooth animations, providing a modern and engaging user interface. + diff --git a/Calculators/Lease-calculator/index.html b/Calculators/Lease-calculator/index.html new file mode 100644 index 000000000..a10d52ce1 --- /dev/null +++ b/Calculators/Lease-calculator/index.html @@ -0,0 +1,40 @@ + + + + + + Lease Calculator + + + +
+

Lease Calculator

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+

Lease Calculation Results

+

Monthly Payment:

+

Total Payment:

+

Total Interest:

+
+
+ + + diff --git a/Calculators/Lease-calculator/script.js b/Calculators/Lease-calculator/script.js new file mode 100644 index 000000000..69c4e5be8 --- /dev/null +++ b/Calculators/Lease-calculator/script.js @@ -0,0 +1,19 @@ +function calculateLease() { + const assetValue = parseFloat(document.getElementById('assetValue').value); + const residualValue = parseFloat(document.getElementById('residualValue').value); + const leaseTerm = parseFloat(document.getElementById('leaseTerm').value) * 12; // Convert years to months + const interestRate = parseFloat(document.getElementById('interestRate').value) / 100 / 12; // Monthly interest rate + + const depreciation = (assetValue - residualValue) / leaseTerm; + const interest = (assetValue + residualValue) * interestRate / 2; + + const monthlyPayment = depreciation + interest; + const totalPayment = monthlyPayment * leaseTerm; + const totalInterest = totalPayment - (assetValue - residualValue); + + document.getElementById('monthlyPayment').innerText = `Monthly Payment: $${monthlyPayment.toFixed(2)}`; + document.getElementById('totalPayment').innerText = `Total Payment: $${totalPayment.toFixed(2)}`; + document.getElementById('totalInterest').innerText = `Total Interest: $${totalInterest.toFixed(2)}`; + + document.getElementById('results').style.display = 'block'; +} diff --git a/Calculators/Lease-calculator/styles.css b/Calculators/Lease-calculator/styles.css new file mode 100644 index 000000000..adb0a9d89 --- /dev/null +++ b/Calculators/Lease-calculator/styles.css @@ -0,0 +1,88 @@ +body { + font-family: Arial, sans-serif; + background: #f4f4f4; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +.container { + background: white; + padding: 20px; + border-radius: 10px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + max-width: 400px; + width: 100%; + animation: fadeIn 1s ease-in-out; +} + +h1 { + text-align: center; + color: #333; +} + +.input-group { + margin-bottom: 15px; +} + +label { + display: block; + margin-bottom: 5px; + color: #555; +} + +input { + width: 100%; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; +} + +button { + width: 100%; + padding: 10px; + background: #28a745; + border: none; + color: white; + border-radius: 5px; + cursor: pointer; + transition: background 0.3s ease; +} + +button:hover { + background: #218838; +} + +.results { + margin-top: 20px; + display: none; + animation: slideIn 0.5s ease-in-out; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes slideIn { + from { + transform: translateY(20px); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } +} + +@media (max-width: 600px) { + .container { + padding: 15px; + } +} diff --git a/index.html b/index.html index 8c1d97bda..e3432787f 100644 --- a/index.html +++ b/index.html @@ -2873,6 +2873,20 @@

Checks whether the entered year is a leap year or not.

+
+
+

Lease Calculator

+

Calculates Lease payments that needs to be paid/h3> + +

+

Least Squares Regression Calculator