/**
 * This function takes in the number of hours worked by a social worker and their hourly rate,
 * and calculates their total payment, including any overtime pay.
 *
 * @param hoursWorked The number of hours worked by the social worker.
 * @param hourlyRate The hourly rate of the social worker.
 * @return The total payment for the social worker.
 * @throws IllegalArgumentException If the number of hours worked is negative or if the hourly rate is negative.
 */
fun calculateSocialWorkerPayment(hoursWorked: Int, hourlyRate: Double): Double {

    if (hoursWorked < 0 || hourlyRate < 0) {
        throw IllegalArgumentException("Hours worked and hourly rate cannot be negative.")
    }

    var basePayment = 0.0
    var overtimePayment = 0.0

    if (hoursWorked <= 40) {
        basePayment = hoursWorked * hourlyRate
    } else {
        basePayment = 40 * hourlyRate
        overtimePayment = (hoursWorked - 40) * hourlyRate * 1.5
    }

    val totalPayment = basePayment + overtimePayment
    return totalPayment
}
/**
 * This function takes in the number of hours worked by a social worker and their hourly rate,
 * and calculates their total payment, including any overtime pay.
 *
 * @param hoursWorked The number of hours worked by the social worker.
 * @param hourlyRate The hourly rate of the social worker.
 * @return The total payment for the social worker.
 * @throws IllegalArgumentException If the number of hours worked is negative or if the hourly rate is negative.
 */
fun calculateSocialWorkerPayment(hoursWorked: Int, hourlyRate: Double): Double {
/**
 * This function takes in the number of hours worked by a social worker and their hourly rate,
 * and calculates their total payment, including any overtime pay.
 *
 * @param hoursWorked The number of hours worked by the social worker.
 * @param hourlyRate The hourly rate of the social worker.
 * @return The total payment for the social worker.
 * @throws IllegalArgumentException If the number of hours worked is negative or if the hourly rate is negative.
 */
fun calculateSocialWorkerPayment(hoursWorked: Int, hourlyRate: Double): Double {

    if (hoursWorked < 0 || hourlyRate < 0) {
        throw IllegalArgumentException("Hours worked and hourly rate cannot be negative.")
    }

    var basePayment = 0.0
    var overtimePayment = 0.0

    if (hoursWorked <= 40) {
        basePayment = hoursWorked * hourlyRate
    } else {
        basePayment = 40 * hourlyRate
        overtimePayment = (hoursWorked - 40) * hourlyRate * 1.5
    }

    val totalPayment = basePayment + overtimePayment
    return totalPayment
}