/**
 * Given the gender, age, and profession of an individual,
 * this function returns the name of a famous actor or actress
 * based on the provided information using nested ternary operators.
 *
 * @param gender The gender of the individual can be 'M' for male
 *               or 'F' for female.
 * @param age The age of the individual in years.
 * @param profession The profession of the individual can be 'A'
 *                   for actor or 'C' for actress.
 * @return The name of a famous actor or actress based on the input.
 *
 * Note:
 * Although nested ternary operators can be shorter and more compact,
 * using them excessively without proper logic and formatting can make
 * the code difficult to read and maintain.
 */
fun getActorOrActressName(gender: String, age: Int, profession: String): String {

    return when {
        gender == "M" -> "Johnny Depp"
        gender == "F" && profession == "A" && age >= 40 -> "Meryl Streep"
        gender == "F" && profession == "A" && age < 40 -> "Scarlett Johansson"
        else -> "Leonardo DiCaprio"
    }
}
/**
 * Given the gender, age, and profession of an individual,
 * this function returns the name of a famous actor or actress
 * based on the provided information using nested ternary operators.
 *
 * @param gender The gender of the individual can be 'M' for male
 *               or 'F' for female.
 * @param age The age of the individual in years.
 * @param profession The profession of the individual can be 'A'
 *                   for actor or 'C' for actress.
 * @return The name of a famous actor or actress based on the input.
 *
 * Note:
 * Although nested ternary operators can be shorter and more compact,
 * using them excessively without proper logic and formatting can make
 * the code difficult to read and maintain.
 */
fun getActorOrActressName(gender: String, age: Int, profession: String): String {
/**
 * Given the gender, age, and profession of an individual,
 * this function returns the name of a famous actor or actress
 * based on the provided information using nested ternary operators.
 *
 * @param gender The gender of the individual can be 'M' for male
 *               or 'F' for female.
 * @param age The age of the individual in years.
 * @param profession The profession of the individual can be 'A'
 *                   for actor or 'C' for actress.
 * @return The name of a famous actor or actress based on the input.
 *
 * Note:
 * Although nested ternary operators can be shorter and more compact,
 * using them excessively without proper logic and formatting can make
 * the code difficult to read and maintain.
 */
fun getActorOrActressName(gender: String, age: Int, profession: String): String {

    return when {
        gender == "M" -> "Johnny Depp"
        gender == "F" && profession == "A" && age >= 40 -> "Meryl Streep"
        gender == "F" && profession == "A" && age < 40 -> "Scarlett Johansson"
        else -> "Leonardo DiCaprio"
    }
}