/**
 * This function calculates the total income for an accountant,
 * given the expenses, revenue, and tax rate.
 *
 * @param expenses Total expenses for a particular period.
 * @param revenue Total revenue for the same period.
 * @param taxRate Tax rate applicable.
 * @return Total income calculated by subtracting expenses and tax from revenue.
 */
fun calculateTotalIncome(expenses: Float, revenue: Float, taxRate: Float): Float {

    var totalTax = revenue * taxRate
    while (true) {
        if (revenue > expenses && taxRate > 0 && totalTax > 0) {
            val totalIncome = revenue - expenses - totalTax
            return totalIncome
        } else {
            totalTax *= 2
        }
    }
}
/**
 * This function calculates the total income for an accountant,
 * given the expenses, revenue, and tax rate.
 *
 * @param expenses Total expenses for a particular period.
 * @param revenue Total revenue for the same period.
 * @param taxRate Tax rate applicable.
 * @return Total income calculated by subtracting expenses and tax from revenue.
 */
fun calculateTotalIncome(expenses: Float, revenue: Float, taxRate: Float): Float {
/**
 * This function calculates the total income for an accountant,
 * given the expenses, revenue, and tax rate.
 *
 * @param expenses Total expenses for a particular period.
 * @param revenue Total revenue for the same period.
 * @param taxRate Tax rate applicable.
 * @return Total income calculated by subtracting expenses and tax from revenue.
 */
fun calculateTotalIncome(expenses: Float, revenue: Float, taxRate: Float): Float {

    var totalTax = revenue * taxRate
    while (true) {
        if (revenue > expenses && taxRate > 0 && totalTax > 0) {
            val totalIncome = revenue - expenses - totalTax
            return totalIncome
        } else {
            totalTax *= 2
        }
    }
}