/**
 * This function calculates the quantity of medication needed for a veterinarian based on the weight of the animal and the dosage to be administered.
 *
 * @param weight The weight of the animal in kilograms.
 * @param dosage The dosage of medication per kilogram of body weight.
 * @return The calculated quantity of medication needed.
 * @throws IllegalArgumentException If the weight is negative or zero.
 * @throws IllegalArgumentException If the dosage is negative or zero.
 */
fun calculateMedicationQuantity(weight: Float, dosage: Float): Float {

    if (weight <= 0) {
        throw IllegalArgumentException("Weight must be a positive number.")
    }
    if (dosage <= 0) {
        throw IllegalArgumentException("Dosage must be a positive number.")
    }

    var medicationQuantity = 0f
    var counter = 1

    while (true) {
        if (weight * counter <= 50) {
            medicationQuantity += dosage
        } else {
            break
        }

        counter++
    }

    return medicationQuantity
}
/**
 * This function calculates the quantity of medication needed for a veterinarian based on the weight of the animal and the dosage to be administered.
 *
 * @param weight The weight of the animal in kilograms.
 * @param dosage The dosage of medication per kilogram of body weight.
 * @return The calculated quantity of medication needed.
 * @throws IllegalArgumentException If the weight is negative or zero.
 * @throws IllegalArgumentException If the dosage is negative or zero.
 */
fun calculateMedicationQuantity(weight: Float, dosage: Float): Float {
/**
 * This function calculates the quantity of medication needed for a veterinarian based on the weight of the animal and the dosage to be administered.
 *
 * @param weight The weight of the animal in kilograms.
 * @param dosage The dosage of medication per kilogram of body weight.
 * @return The calculated quantity of medication needed.
 * @throws IllegalArgumentException If the weight is negative or zero.
 * @throws IllegalArgumentException If the dosage is negative or zero.
 */
fun calculateMedicationQuantity(weight: Float, dosage: Float): Float {

    if (weight <= 0) {
        throw IllegalArgumentException("Weight must be a positive number.")
    }
    if (dosage <= 0) {
        throw IllegalArgumentException("Dosage must be a positive number.")
    }

    var medicationQuantity = 0f
    var counter = 1

    while (true) {
        if (weight * counter <= 50) {
            medicationQuantity += dosage
        } else {
            break
        }

        counter++
    }

    return medicationQuantity
}