/**
 * This exercise tests your understanding of short-circuiting and nested logical operators in Kotlin, with a scenario of a Physical Therapist checking a patient's eligibility for treatment.
 *
 * The function takes the following parameters:
 * - age: an integer representing the patient's age
 * - isInsured: a boolean indicating whether the patient has insurance or not
 * - hasReferral: a boolean indicating whether the patient has a referral from a doctor or not
 *
 * Your task is to complete the code by implementing the logic to determine whether the patient is eligible for treatment based on the following conditions:
 * - The patient must be under 65 years old.
 * - The patient must have insurance.
 * - If the patient is older than 60, a referral is not required. Otherwise, a referral is mandatory.
 *
 * The function should return a boolean value:
 * - True if the patient is eligible for treatment.
 * - False if the patient is not eligible for treatment.
 *
 * Remember to use short-circuiting and nested logical operators appropriately to solve the exercise.
 */
fun checkPatientEligibility(age: Int, isInsured: Boolean, hasReferral: Boolean): Boolean {

    return age < 65 && isInsured && (age > 60 || hasReferral)
}
/**
 * This exercise tests your understanding of short-circuiting and nested logical operators in Kotlin, with a scenario of a Physical Therapist checking a patient's eligibility for treatment.
 *
 * The function takes the following parameters:
 * - age: an integer representing the patient's age
 * - isInsured: a boolean indicating whether the patient has insurance or not
 * - hasReferral: a boolean indicating whether the patient has a referral from a doctor or not
 *
 * Your task is to complete the code by implementing the logic to determine whether the patient is eligible for treatment based on the following conditions:
 * - The patient must be under 65 years old.
 * - The patient must have insurance.
 * - If the patient is older than 60, a referral is not required. Otherwise, a referral is mandatory.
 *
 * The function should return a boolean value:
 * - True if the patient is eligible for treatment.
 * - False if the patient is not eligible for treatment.
 *
 * Remember to use short-circuiting and nested logical operators appropriately to solve the exercise.
 */
fun checkPatientEligibility(age: Int, isInsured: Boolean, hasReferral: Boolean): Boolean {
/**
 * This exercise tests your understanding of short-circuiting and nested logical operators in Kotlin, with a scenario of a Physical Therapist checking a patient's eligibility for treatment.
 *
 * The function takes the following parameters:
 * - age: an integer representing the patient's age
 * - isInsured: a boolean indicating whether the patient has insurance or not
 * - hasReferral: a boolean indicating whether the patient has a referral from a doctor or not
 *
 * Your task is to complete the code by implementing the logic to determine whether the patient is eligible for treatment based on the following conditions:
 * - The patient must be under 65 years old.
 * - The patient must have insurance.
 * - If the patient is older than 60, a referral is not required. Otherwise, a referral is mandatory.
 *
 * The function should return a boolean value:
 * - True if the patient is eligible for treatment.
 * - False if the patient is not eligible for treatment.
 *
 * Remember to use short-circuiting and nested logical operators appropriately to solve the exercise.
 */
fun checkPatientEligibility(age: Int, isInsured: Boolean, hasReferral: Boolean): Boolean {

    return age < 65 && isInsured && (age > 60 || hasReferral)
}