Question: You are working on a program for a hospital pharmacy to automate medication dosage calculations for patients. a program that calculates the required dosage based

You are working on a program for a hospital pharmacy to automate medication dosage calculations for
patients. a program that calculates the required dosage based on the patient's weight
and medication instructions. We are calculating dosages for MegaGood pills (which come in 250 mg
pills), which are used to increase happiness and joy. a program named
MegaGoodDosage.py that takes inputs for multiple patients and calculates the appropriate dosage for
each patient and the number of pills to supply. You will also need to figure out the total number of pills
prescribed for all patients.
Write a Python program to perform the following steps:
1. Prompt the user to enter the number of patients for whom dosages need to be calculated.
2. For each patient, read and store their weight in kilograms and their age in years.
3. For each patient, read and store the number of days that the prescription should be administered.
4. Calculate the appropriate dosage of the drug based on the patient's age:
o If the patient's age is below 12, assign a dosage of 5 mg per kilogram of body weight per
application. These patients take it once a day.
o If the patient's age is 12 or older, assign a dosage of 10 mg per kilogram of body weight
per application. These patients take it twice a day.
5. Display the results (see below).
Your program output needs to be close to identical to the following sample
Note: Assume that the user enters valid input for the number of patients, patient weight, and patient age.
Example output:
Welcome to my dosage calculator
We are calculating dosages for MegaGood pills, which come in 250 mg pills
and are used to increase your health.
Under 12: mg dose is 5 times kg weight rounded up (once a day)
12 and over: mg dose is 10 times kg weight rounded up (twice a day)
Enter the number of patients: 2
Patient 1 :
Enter the weight of the patient (in kilograms): 55
Enter the age of the patient (in years): 50
Enter the number of days for the prescription: 10
The calculated dosage for Patient 1 is 550 mg 2 times per day
They will need to take 6 pills per day for a total of 1500 mg per day.
For 10 days, the patient will need 60 pills.
Patient 2 :
Enter the weight of the patient (in kilograms): 30
Enter the age of the patient (in years): 9
Enter the number of days for the prescription: 20
The calculated dosage for Patient 2 is 150 mg 1 times per day
They will need to take 1 pills per day for a total of 250 mg per day.
For 20 days, the patient will need 20 pills.
The total number of pills prescribed for all patients is 80

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!