/**
 * This function checks if a nurse is scheduled to work on a particular day based on the number of hours worked
 */
fun nurseSchedule(name: String, day: String, hoursWorked: Int): String {

    val scheduledDays = listOf("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
    val scheduledHours = listOf(8, 7, 6, 9, 8)
    var dayIndex = -1

    // Find the index of the current day in the scheduledDays list
    for ((index, scheduledDay) in scheduledDays.withIndex()) {
        if (scheduledDay == day) {
            dayIndex = index
            break
        }
    }

    // If the day is not found in the scheduledDays list, nurse is not scheduled to work
    if (dayIndex == -1) {
        return "$name is not scheduled to work on $day."
    }

    // If the hours worked is greater than or equal to the scheduled hours for the day, nurse is scheduled to work
    if (hoursWorked >= scheduledHours[dayIndex]) {
        return "$name is scheduled to work on $day."
    }

    // Nurse is not scheduled to work because the above conditions were not met
    return "$name is not scheduled to work on $day."
}
/**
 * This function checks if a nurse is scheduled to work on a particular day based on the number of hours worked
 */
fun nurseSchedule(name: String, day: String, hoursWorked: Int): String {
/**
 * This function checks if a nurse is scheduled to work on a particular day based on the number of hours worked
 */
fun nurseSchedule(name: String, day: String, hoursWorked: Int): String {

    val scheduledDays = listOf("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
    val scheduledHours = listOf(8, 7, 6, 9, 8)
    var dayIndex = -1

    // Find the index of the current day in the scheduledDays list
    for ((index, scheduledDay) in scheduledDays.withIndex()) {
        if (scheduledDay == day) {
            dayIndex = index
            break
        }
    }

    // If the day is not found in the scheduledDays list, nurse is not scheduled to work
    if (dayIndex == -1) {
        return "$name is not scheduled to work on $day."
    }

    // If the hours worked is greater than or equal to the scheduled hours for the day, nurse is scheduled to work
    if (hoursWorked >= scheduledHours[dayIndex]) {
        return "$name is scheduled to work on $day."
    }

    // Nurse is not scheduled to work because the above conditions were not met
    return "$name is not scheduled to work on $day."
}