From 5ade6e740fda42570ccd73982f70b262c67059b8 Mon Sep 17 00:00:00 2001 From: Prabhnoor0 Date: Mon, 13 Apr 2026 19:26:38 +0530 Subject: [PATCH 1/2] test1 --- Calculator/TaxLogic.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Calculator/TaxLogic.swift b/Calculator/TaxLogic.swift index 2f5550a..1e57cb6 100644 --- a/Calculator/TaxLogic.swift +++ b/Calculator/TaxLogic.swift @@ -12,6 +12,7 @@ /// - taxRate: Applicable tax rate as a percentage (e.g., pass 20 for 20 %). /// - Returns: A tuple with the calculated `taxAmount` and the resulting `netIncome`. func calculateTax(income: Double, taxRate: Double) -> (taxAmount: Double, netIncome: Double) { - - return (0, 0) + let taxAmount = income * taxRate / 100.0 + let netIncome = income - taxAmount + return (taxAmount, netIncome) } \ No newline at end of file From ed5f5ffd1e83e1970263b14a08f80fe86abf8c2f Mon Sep 17 00:00:00 2001 From: Prabhnoor0 Date: Mon, 13 Apr 2026 19:27:37 +0530 Subject: [PATCH 2/2] trial --- Calculator/TaxLogic.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Calculator/TaxLogic.swift b/Calculator/TaxLogic.swift index 1e57cb6..6400dd5 100644 --- a/Calculator/TaxLogic.swift +++ b/Calculator/TaxLogic.swift @@ -11,6 +11,8 @@ /// - income: Gross income in ₹. /// - taxRate: Applicable tax rate as a percentage (e.g., pass 20 for 20 %). /// - Returns: A tuple with the calculated `taxAmount` and the resulting `netIncome`. +/// +import Foundation func calculateTax(income: Double, taxRate: Double) -> (taxAmount: Double, netIncome: Double) { let taxAmount = income * taxRate / 100.0 let netIncome = income - taxAmount