/**
 * Given the work hours and rate, calculate the salary of an accountant.
 *
 * @param workHours The number of weekly work hours.
 * @param rate The hourly rate.
 * @return The total salary of the accountant.
 */
fun calculateSalary(workHours: Int, rate: Double): Double {

    var totalSalary = 0.0

    for (week in 1 until 5) {
        if (week != 3) { // If it is not the 3rd week
            for (day in 1 until 6) {
                if (day != 1 && day != 5) { // If it is neither Monday nor Friday
                    if (workHours <= 40) { // If work hours are less than or equal to 40
                        val salary = workHours * rate
                        totalSalary += salary
                    } else { // If work hours are more than 40
                        val overtimeHours = workHours - 40
                        val overtimeSalary = overtimeHours * (rate * 1.5)
                        totalSalary += (40 * rate + overtimeSalary)
                    }
                }
            }
        }
    }

    return totalSalary
}
/**
 * Given the work hours and rate, calculate the salary of an accountant.
 *
 * @param workHours The number of weekly work hours.
 * @param rate The hourly rate.
 * @return The total salary of the accountant.
 */
fun calculateSalary(workHours: Int, rate: Double): Double {
/**
 * Given the work hours and rate, calculate the salary of an accountant.
 *
 * @param workHours The number of weekly work hours.
 * @param rate The hourly rate.
 * @return The total salary of the accountant.
 */
fun calculateSalary(workHours: Int, rate: Double): Double {

    var totalSalary = 0.0

    for (week in 1 until 5) {
        if (week != 3) { // If it is not the 3rd week
            for (day in 1 until 6) {
                if (day != 1 && day != 5) { // If it is neither Monday nor Friday
                    if (workHours <= 40) { // If work hours are less than or equal to 40
                        val salary = workHours * rate
                        totalSalary += salary
                    } else { // If work hours are more than 40
                        val overtimeHours = workHours - 40
                        val overtimeSalary = overtimeHours * (rate * 1.5)
                        totalSalary += (40 * rate + overtimeSalary)
                    }
                }
            }
        }
    }

    return totalSalary
}