/**
 * This function determines whether a person is a dancer based on their name, age, and experience.
 */
fun isDancer(name: String, age: Int, experience: Int): Boolean {

    // Check if the person's name starts with the letter 'D' and ends with 'er'
    if (name.first() == 'D' && name.takeLast(2) == "er") {
        // Check if the person's age is greater than 18 and their experience is greater than or equal to 5
        if (age > 18 && experience >= 5) {
            return true
        }
        // Check if the person's age is between 15 and 17 (inclusive) and their experience is greater than or equal to 3
        else if (age in 15..17 && experience >= 3) {
            return true
        }
        // Check if the person's age is less than or equal to 14 and their experience is greater than or equal to 1
        else if (age <= 14 && experience >= 1) {
            return true
        }
    }
    return false
}
/**
 * This function determines whether a person is a dancer based on their name, age, and experience.
 */
fun isDancer(name: String, age: Int, experience: Int): Boolean {
/**
 * This function determines whether a person is a dancer based on their name, age, and experience.
 */
fun isDancer(name: String, age: Int, experience: Int): Boolean {

    // Check if the person's name starts with the letter 'D' and ends with 'er'
    if (name.first() == 'D' && name.takeLast(2) == "er") {
        // Check if the person's age is greater than 18 and their experience is greater than or equal to 5
        if (age > 18 && experience >= 5) {
            return true
        }
        // Check if the person's age is between 15 and 17 (inclusive) and their experience is greater than or equal to 3
        else if (age in 15..17 && experience >= 3) {
            return true
        }
        // Check if the person's age is less than or equal to 14 and their experience is greater than or equal to 1
        else if (age <= 14 && experience >= 1) {
            return true
        }
    }
    return false
}