/**
 * Create a function to calculate the profit of an accountant based on the following parameters:
 *
 * @param revenue total revenue generated by the accountant
 * @param expenses total expenses incurred by the accountant
 * @param taxRate tax rate applicable to the accountant's profit
 * @param membershipStatus indicates whether the accountant is a member of a professional accounting organization
 * @return calculated profit after deducting expenses and tax
 */
fun calculateProfit(revenue: Double, expenses: Double, taxRate: Double, membershipStatus: Boolean): Double {

    // Calculate the net income before tax
    val netIncome = revenue - expenses

    // Apply tax only if the accountant is not a member of a professional accounting organization
    return if (!membershipStatus) {
        netIncome - (netIncome * taxRate)
    } else {
        netIncome
    }
}
/**
 * Create a function to calculate the profit of an accountant based on the following parameters:
 *
 * @param revenue total revenue generated by the accountant
 * @param expenses total expenses incurred by the accountant
 * @param taxRate tax rate applicable to the accountant's profit
 * @param membershipStatus indicates whether the accountant is a member of a professional accounting organization
 * @return calculated profit after deducting expenses and tax
 */
fun calculateProfit(revenue: Double, expenses: Double, taxRate: Double, membershipStatus: Boolean): Double {
/**
 * Create a function to calculate the profit of an accountant based on the following parameters:
 *
 * @param revenue total revenue generated by the accountant
 * @param expenses total expenses incurred by the accountant
 * @param taxRate tax rate applicable to the accountant's profit
 * @param membershipStatus indicates whether the accountant is a member of a professional accounting organization
 * @return calculated profit after deducting expenses and tax
 */
fun calculateProfit(revenue: Double, expenses: Double, taxRate: Double, membershipStatus: Boolean): Double {

    // Calculate the net income before tax
    val netIncome = revenue - expenses

    // Apply tax only if the accountant is not a member of a professional accounting organization
    return if (!membershipStatus) {
        netIncome - (netIncome * taxRate)
    } else {
        netIncome
    }
}