/**
 * Calculates the age of a veterinarian based on their year of birth and the current year.
 * The veterinarian must be older than 18 years and younger than 65 years to provide services.
 * Uses an alternative to the ternary operator for conditional statements.
 *
 * @param yearOfBirth The year the veterinarian was born.
 * @param currentYear The current year.
 * @return A message indicating the age of the veterinarian and their eligibility to provide services.
 */
fun calculateAge(yearOfBirth: Int, currentYear: Int): String {

    val age = currentYear - yearOfBirth  // Calculate the age of the veterinarian

    val ageMessage = if (age in 19 until 65) {
        "The veterinarian is $age years old and is eligible to provide services."
    } else {
        "The veterinarian is $age years old and is not eligible to provide services."
    }

    return ageMessage
}
/**
 * Calculates the age of a veterinarian based on their year of birth and the current year.
 * The veterinarian must be older than 18 years and younger than 65 years to provide services.
 * Uses an alternative to the ternary operator for conditional statements.
 *
 * @param yearOfBirth The year the veterinarian was born.
 * @param currentYear The current year.
 * @return A message indicating the age of the veterinarian and their eligibility to provide services.
 */
fun calculateAge(yearOfBirth: Int, currentYear: Int): String {
/**
 * Calculates the age of a veterinarian based on their year of birth and the current year.
 * The veterinarian must be older than 18 years and younger than 65 years to provide services.
 * Uses an alternative to the ternary operator for conditional statements.
 *
 * @param yearOfBirth The year the veterinarian was born.
 * @param currentYear The current year.
 * @return A message indicating the age of the veterinarian and their eligibility to provide services.
 */
fun calculateAge(yearOfBirth: Int, currentYear: Int): String {

    val age = currentYear - yearOfBirth  // Calculate the age of the veterinarian

    val ageMessage = if (age in 19 until 65) {
        "The veterinarian is $age years old and is eligible to provide services."
    } else {
        "The veterinarian is $age years old and is not eligible to provide services."
    }

    return ageMessage
}