/**
 * This function calculates the dosage of medicine for a patient based on their age and weight.
 * @param age The age of the patient in years.
 * @param weight The weight of the patient in kilograms.
 * @return The calculated medicine dosage.
 */
fun calculateMedicineDosage(age: Int, weight: Double): Double {

    var dosage = 0.0

    when {
        age >= 12 -> dosage = weight * 0.5
        age < 12 && weight > 30 -> dosage = weight * 0.3
        age < 12 && weight <= 30 -> dosage = weight * 0.2
        else -> dosage = 0.0
    }

    return dosage
}
/**
 * This function calculates the dosage of medicine for a patient based on their age and weight.
 * @param age The age of the patient in years.
 * @param weight The weight of the patient in kilograms.
 * @return The calculated medicine dosage.
 */
fun calculateMedicineDosage(age: Int, weight: Double): Double {
/**
 * This function calculates the dosage of medicine for a patient based on their age and weight.
 * @param age The age of the patient in years.
 * @param weight The weight of the patient in kilograms.
 * @return The calculated medicine dosage.
 */
fun calculateMedicineDosage(age: Int, weight: Double): Double {

    var dosage = 0.0

    when {
        age >= 12 -> dosage = weight * 0.5
        age < 12 && weight > 30 -> dosage = weight * 0.3
        age < 12 && weight <= 30 -> dosage = weight * 0.2
        else -> dosage = 0.0
    }

    return dosage
}