/**
 * This function takes the income of an Accountant and calculates the tax amount.
 *
 * @param income The income of the Accountant.
 * @return The tax amount to be paid.
 */
fun calculateTax(income: Double): Double {

    if (income == null) {
        return 0.0
    }

    // Calculate tax based on income
    val taxBrackets = mapOf(
        10000 to 0.0,
        20000 to 0.1,
        30000 to 0.2,
        40000 to 0.3,
        50000 to 0.4
    )

    var taxAmount = 0.0
    for ((maxIncome, taxRate) in taxBrackets) {
        if (income >= maxIncome) {
            taxAmount = income * taxRate
        }
    }

    return taxAmount
}
/**
 * This function takes the income of an Accountant and calculates the tax amount.
 *
 * @param income The income of the Accountant.
 * @return The tax amount to be paid.
 */
fun calculateTax(income: Double): Double {
/**
 * This function takes the income of an Accountant and calculates the tax amount.
 *
 * @param income The income of the Accountant.
 * @return The tax amount to be paid.
 */
fun calculateTax(income: Double): Double {

    if (income == null) {
        return 0.0
    }

    // Calculate tax based on income
    val taxBrackets = mapOf(
        10000 to 0.0,
        20000 to 0.1,
        30000 to 0.2,
        40000 to 0.3,
        50000 to 0.4
    )

    var taxAmount = 0.0
    for ((maxIncome, taxRate) in taxBrackets) {
        if (income >= maxIncome) {
            taxAmount = income * taxRate
        }
    }

    return taxAmount
}