/**
 * This function calculates the bill for an electrician based on the number of hours worked and the hourly rate.
 * If the number of hours worked is less than or equal to 40, the bill is calculated using the standard rate.
 * If the number of hours worked is greater than 40, the bill is calculated by adding overtime charges at a higher rate.
 * The function returns the total bill amount.
 */
fun calculateBill(hours: Int, rate: Int): Int {

    val standardRate = 15
    val overtimeHours = 40
    val overtimeRate = 25

    if (hours <= 0) {
        return -1 // Invalid input: Number of hours worked cannot be negative or zero.
    } else if (rate <= 0) {
        return -2 // Invalid input: Hourly rate cannot be negative or zero.
    } else {
        val bill: Int
        if (hours <= overtimeHours) {
            bill = hours * rate
        } else {
            val regularBill = overtimeHours * rate
            val overtimeBill = (hours - overtimeHours) * overtimeRate
            bill = regularBill + overtimeBill
        }
        return bill
    }
}
/**
 * This function calculates the bill for an electrician based on the number of hours worked and the hourly rate.
 * If the number of hours worked is less than or equal to 40, the bill is calculated using the standard rate.
 * If the number of hours worked is greater than 40, the bill is calculated by adding overtime charges at a higher rate.
 * The function returns the total bill amount.
 */
fun calculateBill(hours: Int, rate: Int): Int {
/**
 * This function calculates the bill for an electrician based on the number of hours worked and the hourly rate.
 * If the number of hours worked is less than or equal to 40, the bill is calculated using the standard rate.
 * If the number of hours worked is greater than 40, the bill is calculated by adding overtime charges at a higher rate.
 * The function returns the total bill amount.
 */
fun calculateBill(hours: Int, rate: Int): Int {

    val standardRate = 15
    val overtimeHours = 40
    val overtimeRate = 25

    if (hours <= 0) {
        return -1 // Invalid input: Number of hours worked cannot be negative or zero.
    } else if (rate <= 0) {
        return -2 // Invalid input: Hourly rate cannot be negative or zero.
    } else {
        val bill: Int
        if (hours <= overtimeHours) {
            bill = hours * rate
        } else {
            val regularBill = overtimeHours * rate
            val overtimeBill = (hours - overtimeHours) * overtimeRate
            bill = regularBill + overtimeBill
        }
        return bill
    }
}