/**
 * Calculate the profit from revenue and expenses.
 *
 * If the revenue is greater than the expenses, return the profit.
 * If the expenses are greater than the revenue, return null.
 * If the revenue and expenses are equal, return 0.
 *
 * @param revenue The total revenue.
 * @param expenses The total expenses.
 * @return The profit calculated.
 */
fun calculateProfit(revenue: Double, expenses: Double): Double? {

    val profit = revenue - expenses

    return when {
        revenue > expenses -> profit
        revenue < expenses -> null
        else -> 0.0
    }
}
/**
 * Calculate the profit from revenue and expenses.
 *
 * If the revenue is greater than the expenses, return the profit.
 * If the expenses are greater than the revenue, return null.
 * If the revenue and expenses are equal, return 0.
 *
 * @param revenue The total revenue.
 * @param expenses The total expenses.
 * @return The profit calculated.
 */
fun calculateProfit(revenue: Double, expenses: Double): Double? {
/**
 * Calculate the profit from revenue and expenses.
 *
 * If the revenue is greater than the expenses, return the profit.
 * If the expenses are greater than the revenue, return null.
 * If the revenue and expenses are equal, return 0.
 *
 * @param revenue The total revenue.
 * @param expenses The total expenses.
 * @return The profit calculated.
 */
fun calculateProfit(revenue: Double, expenses: Double): Double? {

    val profit = revenue - expenses

    return when {
        revenue > expenses -> profit
        revenue < expenses -> null
        else -> 0.0
    }
}