/**
 * Given the name of an actor/actress, current year, and their birth year,
 * return their age using nested if statements and the unconditioned ternary operator.
 *
 * @param actorName The name of the actor/actress.
 * @param currentYear The current year.
 * @param birthYear The birth year of the actor/actress.
 * @return The age of the actor/actress.
 */
fun findActorAge(actorName: String, currentYear: Int, birthYear: Int): Int {

    // Calculate age using the nested if statements and unconditioned ternary operator
    val age = if (currentYear > birthYear) currentYear - birthYear else null

    age?.let {
        when {
            currentYear < birthYear -> println("$actorName has not been born yet!")
            it <= 10 -> println("$actorName is a child actor/actress.")
            it <= 20 -> println("$actorName is a teenage actor/actress.")
            it <= 30 -> println("$actorName is a young adult actor/actress.")
            it <= 40 -> println("$actorName is an actor/actress in their prime.")
            else -> println("$actorName is an experienced actor/actress.")
        }
    }

    return age ?: 0
}
/**
 * Given the name of an actor/actress, current year, and their birth year,
 * return their age using nested if statements and the unconditioned ternary operator.
 *
 * @param actorName The name of the actor/actress.
 * @param currentYear The current year.
 * @param birthYear The birth year of the actor/actress.
 * @return The age of the actor/actress.
 */
fun findActorAge(actorName: String, currentYear: Int, birthYear: Int): Int {
/**
 * Given the name of an actor/actress, current year, and their birth year,
 * return their age using nested if statements and the unconditioned ternary operator.
 *
 * @param actorName The name of the actor/actress.
 * @param currentYear The current year.
 * @param birthYear The birth year of the actor/actress.
 * @return The age of the actor/actress.
 */
fun findActorAge(actorName: String, currentYear: Int, birthYear: Int): Int {

    // Calculate age using the nested if statements and unconditioned ternary operator
    val age = if (currentYear > birthYear) currentYear - birthYear else null

    age?.let {
        when {
            currentYear < birthYear -> println("$actorName has not been born yet!")
            it <= 10 -> println("$actorName is a child actor/actress.")
            it <= 20 -> println("$actorName is a teenage actor/actress.")
            it <= 30 -> println("$actorName is a young adult actor/actress.")
            it <= 40 -> println("$actorName is an actor/actress in their prime.")
            else -> println("$actorName is an experienced actor/actress.")
        }
    }

    return age ?: 0
}