/**
 * A farmer wants to calculate the profit made from selling crops.
 * However, there can be a floating-point error when subtracting expenses from revenue.
 * To handle this, the farmer should use an epsilon value to check if the difference is within a small range.
 * If the difference is within the range, the farmer considers it as zero profit.
 * The farmer wants to display the profit as "Profit: <amount>".
 * If there is zero profit, the farmer should add an "else" statement to display "Profit is zero".
 */
fun calculateProfit(revenue: Double, expenses: Double) {

    val epsilon = 0.0001  // Epsilon value to check for floating-point error

    // Calculate the profit
    val profit = revenue - expenses

    // Check if the profit is within the epsilon range
    if (-epsilon < profit && profit < epsilon) {
        println("Profit is zero")
    } else {
        println("Profit: $profit")
    }
}
/**
 * A farmer wants to calculate the profit made from selling crops.
 * However, there can be a floating-point error when subtracting expenses from revenue.
 * To handle this, the farmer should use an epsilon value to check if the difference is within a small range.
 * If the difference is within the range, the farmer considers it as zero profit.
 * The farmer wants to display the profit as "Profit: <amount>".
 * If there is zero profit, the farmer should add an "else" statement to display "Profit is zero".
 */
fun calculateProfit(revenue: Double, expenses: Double) {
/**
 * A farmer wants to calculate the profit made from selling crops.
 * However, there can be a floating-point error when subtracting expenses from revenue.
 * To handle this, the farmer should use an epsilon value to check if the difference is within a small range.
 * If the difference is within the range, the farmer considers it as zero profit.
 * The farmer wants to display the profit as "Profit: <amount>".
 * If there is zero profit, the farmer should add an "else" statement to display "Profit is zero".
 */
fun calculateProfit(revenue: Double, expenses: Double) {

    val epsilon = 0.0001  // Epsilon value to check for floating-point error

    // Calculate the profit
    val profit = revenue - expenses

    // Check if the profit is within the epsilon range
    if (-epsilon < profit && profit < epsilon) {
        println("Profit is zero")
    } else {
        println("Profit: $profit")
    }
}