/**
 * This function diagnoses the health condition of pets based on their age and weight.
 *
 * @param petAge The age of the pet in years.
 * @param petWeight The weight of the pet in kilograms.
 * @return The diagnosis of the pet's health condition.
 */
fun diagnosePets(petAge: Int, petWeight: Float): String {

    return when {
        petAge < 3 -> {
            when {
                petWeight < 5 -> "The pet is underweight for its age."
                petWeight > 10 -> "The pet is overweight for its age."
                else -> "The pet is within a healthy weight range for its age."
            }
        }
        petAge in 3 until 6 -> {
            when {
                petWeight < 5 -> "The pet is underweight for its age."
                petWeight > 9 -> "The pet is overweight for its age."
                else -> "The pet is within a healthy weight range for its age."
            }
        }
        else -> {
            when {
                petWeight < 5 -> "The pet is underweight for its age."
                petWeight > 8 -> "The pet is overweight for its age."
                else -> "The pet is within a healthy weight range for its age."
            }
        }
    }
}
/**
 * This function diagnoses the health condition of pets based on their age and weight.
 *
 * @param petAge The age of the pet in years.
 * @param petWeight The weight of the pet in kilograms.
 * @return The diagnosis of the pet's health condition.
 */
fun diagnosePets(petAge: Int, petWeight: Float): String {
/**
 * This function diagnoses the health condition of pets based on their age and weight.
 *
 * @param petAge The age of the pet in years.
 * @param petWeight The weight of the pet in kilograms.
 * @return The diagnosis of the pet's health condition.
 */
fun diagnosePets(petAge: Int, petWeight: Float): String {

    return when {
        petAge < 3 -> {
            when {
                petWeight < 5 -> "The pet is underweight for its age."
                petWeight > 10 -> "The pet is overweight for its age."
                else -> "The pet is within a healthy weight range for its age."
            }
        }
        petAge in 3 until 6 -> {
            when {
                petWeight < 5 -> "The pet is underweight for its age."
                petWeight > 9 -> "The pet is overweight for its age."
                else -> "The pet is within a healthy weight range for its age."
            }
        }
        else -> {
            when {
                petWeight < 5 -> "The pet is underweight for its age."
                petWeight > 8 -> "The pet is overweight for its age."
                else -> "The pet is within a healthy weight range for its age."
            }
        }
    }
}