/**
 * Calculate the age in years based on the year of birth and the current year.
 *
 * Use the ternary operator to display the advantages of using ternary operator with multiple conditions.
 *
 * @param yearOfBirth The year in which the person was born.
 * @param currentYear The current year.
 * @return A string describing the age category based on the calculated age.
 */
fun calculateAge(yearOfBirth: Int, currentYear: Int): String {

    val age = currentYear - yearOfBirth
    val ageCategory = when {
        age < 1 -> "Infant"
        age < 4 -> "Toddler"
        age < 12 -> "Child"
        age < 18 -> "Teenager"
        else -> "Adult"
    }
    return ageCategory
}
/**
 * Calculate the age in years based on the year of birth and the current year.
 *
 * Use the ternary operator to display the advantages of using ternary operator with multiple conditions.
 *
 * @param yearOfBirth The year in which the person was born.
 * @param currentYear The current year.
 * @return A string describing the age category based on the calculated age.
 */
fun calculateAge(yearOfBirth: Int, currentYear: Int): String {
/**
 * Calculate the age in years based on the year of birth and the current year.
 *
 * Use the ternary operator to display the advantages of using ternary operator with multiple conditions.
 *
 * @param yearOfBirth The year in which the person was born.
 * @param currentYear The current year.
 * @return A string describing the age category based on the calculated age.
 */
fun calculateAge(yearOfBirth: Int, currentYear: Int): String {

    val age = currentYear - yearOfBirth
    val ageCategory = when {
        age < 1 -> "Infant"
        age < 4 -> "Toddler"
        age < 12 -> "Child"
        age < 18 -> "Teenager"
        else -> "Adult"
    }
    return ageCategory
}