/**
 * Calculates the salary of a carpenter with bonus based on hours worked and hourly rate.
 *
 * @param hoursWorked the number of hours worked
 * @param hourlyRate the rate per hour
 * @return the total salary of the carpenter, including bonus
 */
fun calculateCarpenterSalary(hoursWorked: Int, hourlyRate: Double): Double {

    var totalSalary = hoursWorked * hourlyRate
    if (hoursWorked > 40) {
        val bonus = (hoursWorked - 40) * 0.5 * hourlyRate  // Calculate the bonus for extra working hours
        totalSalary += bonus
    }
    return totalSalary
}
/**
 * Calculates the salary of a carpenter with bonus based on hours worked and hourly rate.
 *
 * @param hoursWorked the number of hours worked
 * @param hourlyRate the rate per hour
 * @return the total salary of the carpenter, including bonus
 */
fun calculateCarpenterSalary(hoursWorked: Int, hourlyRate: Double): Double {
/**
 * Calculates the salary of a carpenter with bonus based on hours worked and hourly rate.
 *
 * @param hoursWorked the number of hours worked
 * @param hourlyRate the rate per hour
 * @return the total salary of the carpenter, including bonus
 */
fun calculateCarpenterSalary(hoursWorked: Int, hourlyRate: Double): Double {

    var totalSalary = hoursWorked * hourlyRate
    if (hoursWorked > 40) {
        val bonus = (hoursWorked - 40) * 0.5 * hourlyRate  // Calculate the bonus for extra working hours
        totalSalary += bonus
    }
    return totalSalary
}