/**
 * A Nurse needs to calculate the dosage of a medication for a patient.
 * In this exercise, you need to complete the code to calculate the dosage by checking the patient's weight and the dosage guidelines.
 *
 * @param weight The weight of the patient in kg.
 * @param numPills The number of pills the patient needs to take.
 * @param dosage The standard dosage recommended for the patient.
 * @return The calculated dosage that the patient should take.
 */
fun calculateDosage(weight: Double, numPills: Int, dosage: Int): Double {

    var updatedDosage = dosage

    if (weight > 100) {
        updatedDosage += 20
    }

    val dosagePerPill = updatedDosage.toDouble() / numPills
    var totalDosage = dosagePerPill

    repeat(numPills) {
        totalDosage += dosagePerPill
    }

    return totalDosage
}
/**
 * A Nurse needs to calculate the dosage of a medication for a patient.
 * In this exercise, you need to complete the code to calculate the dosage by checking the patient's weight and the dosage guidelines.
 *
 * @param weight The weight of the patient in kg.
 * @param numPills The number of pills the patient needs to take.
 * @param dosage The standard dosage recommended for the patient.
 * @return The calculated dosage that the patient should take.
 */
fun calculateDosage(weight: Double, numPills: Int, dosage: Int): Double {
/**
 * A Nurse needs to calculate the dosage of a medication for a patient.
 * In this exercise, you need to complete the code to calculate the dosage by checking the patient's weight and the dosage guidelines.
 *
 * @param weight The weight of the patient in kg.
 * @param numPills The number of pills the patient needs to take.
 * @param dosage The standard dosage recommended for the patient.
 * @return The calculated dosage that the patient should take.
 */
fun calculateDosage(weight: Double, numPills: Int, dosage: Int): Double {

    var updatedDosage = dosage

    if (weight > 100) {
        updatedDosage += 20
    }

    val dosagePerPill = updatedDosage.toDouble() / numPills
    var totalDosage = dosagePerPill

    repeat(numPills) {
        totalDosage += dosagePerPill
    }

    return totalDosage
}