/**
 * This function calculates the tax deductions for an accountant based on their income, expenses, and dependents.
 *
 * @param income The accountant's total annual income.
 * @param expenses The accountant's total annual expenses.
 * @param dependents The number of dependents the accountant has.
 * @return The tax deductions calculated for the accountant.
 */
fun calculateTaxDeductions(income: Double, expenses: Double, dependents: Int): Double {

    val deductionPercent = 0.25 // Assume a fixed 25% deduction rate
    val maxDeduction = 100000.0 // Maximum deduction limit

    // Calculate the tax deductions using conditional statements
    var deductions = if (expenses > income * deductionPercent) {
        maxOf(income * deductionPercent - expenses, maxDeduction)
    } else {
        income * deductionPercent - expenses
    }

    deductions = if (deductions > maxDeduction) {
        maxDeduction
    } else {
        deductions
    }

    val finalDeductions = if (dependents > 0) {
        maxOf(deductions, deductions * dependents, 0.0)
    } else {
        deductions
    }

    return finalDeductions
}
/**
 * This function calculates the tax deductions for an accountant based on their income, expenses, and dependents.
 *
 * @param income The accountant's total annual income.
 * @param expenses The accountant's total annual expenses.
 * @param dependents The number of dependents the accountant has.
 * @return The tax deductions calculated for the accountant.
 */
fun calculateTaxDeductions(income: Double, expenses: Double, dependents: Int): Double {
/**
 * This function calculates the tax deductions for an accountant based on their income, expenses, and dependents.
 *
 * @param income The accountant's total annual income.
 * @param expenses The accountant's total annual expenses.
 * @param dependents The number of dependents the accountant has.
 * @return The tax deductions calculated for the accountant.
 */
fun calculateTaxDeductions(income: Double, expenses: Double, dependents: Int): Double {

    val deductionPercent = 0.25 // Assume a fixed 25% deduction rate
    val maxDeduction = 100000.0 // Maximum deduction limit

    // Calculate the tax deductions using conditional statements
    var deductions = if (expenses > income * deductionPercent) {
        maxOf(income * deductionPercent - expenses, maxDeduction)
    } else {
        income * deductionPercent - expenses
    }

    deductions = if (deductions > maxDeduction) {
        maxDeduction
    } else {
        deductions
    }

    val finalDeductions = if (dependents > 0) {
        maxOf(deductions, deductions * dependents, 0.0)
    } else {
        deductions
    }

    return finalDeductions
}