/**
 * This function takes in an actor's name, age, and the year in which a movie was released.
 * It returns the number of Oscars won by the actor, based on the following conditions:
 * - If the actor's name starts with 'A' and their age is less than 40, they have won 3 Oscars.
 * - If the actor's name starts with 'J' and the movie's release year is after 2005, they have won 2 Oscars.
 * - If the actor's name starts with 'M' and the actor's age is between 40 and 50 (inclusive), they have won 1 Oscar.
 * - For any other combination of conditions, the actor has won 0 Oscars.
 */
fun getOscars(actorName: String, actorAge: Int, movieYear: Int): Int {

    return when {
        actorName.startsWith('A') && actorAge < 40 -> 3
        actorName.startsWith('J') && movieYear > 2005 -> 2
        actorName.startsWith('M') && actorAge in 40..50 -> 1
        else -> 0
    }
}
/**
 * This function takes in an actor's name, age, and the year in which a movie was released.
 * It returns the number of Oscars won by the actor, based on the following conditions:
 * - If the actor's name starts with 'A' and their age is less than 40, they have won 3 Oscars.
 * - If the actor's name starts with 'J' and the movie's release year is after 2005, they have won 2 Oscars.
 * - If the actor's name starts with 'M' and the actor's age is between 40 and 50 (inclusive), they have won 1 Oscar.
 * - For any other combination of conditions, the actor has won 0 Oscars.
 */
fun getOscars(actorName: String, actorAge: Int, movieYear: Int): Int {
/**
 * This function takes in an actor's name, age, and the year in which a movie was released.
 * It returns the number of Oscars won by the actor, based on the following conditions:
 * - If the actor's name starts with 'A' and their age is less than 40, they have won 3 Oscars.
 * - If the actor's name starts with 'J' and the movie's release year is after 2005, they have won 2 Oscars.
 * - If the actor's name starts with 'M' and the actor's age is between 40 and 50 (inclusive), they have won 1 Oscar.
 * - For any other combination of conditions, the actor has won 0 Oscars.
 */
fun getOscars(actorName: String, actorAge: Int, movieYear: Int): Int {

    return when {
        actorName.startsWith('A') && actorAge < 40 -> 3
        actorName.startsWith('J') && movieYear > 2005 -> 2
        actorName.startsWith('M') && actorAge in 40..50 -> 1
        else -> 0
    }
}