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 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:
Prompt the user to enter the number of patients for whom dosages need to be calculated.
For each patient, read and store their weight in kilograms and their age in years.
For each patient, read and store the number of days that the prescription should be administered.
Calculate the appropriate dosage of the drug based on the patient's age:
o If the patient's age is below assign a dosage of mg per kilogram of body weight per
application. These patients take it once a day.
o If the patient's age is or older, assign a dosage of mg per kilogram of body weight
per application. These patients take it twice a day.
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 mg pills
and are used to increase your health.
Under : mg dose is times kg weight rounded up once a day
and over: mg dose is times kg weight rounded up twice a day
Enter the number of patients:
Patient :
Enter the weight of the patient in kilograms:
Enter the age of the patient in years:
Enter the number of days for the prescription:
The calculated dosage for Patient is mg times per day
They will need to take pills per day for a total of mg per day.
For days, the patient will need pills.
Patient :
Enter the weight of the patient in kilograms:
Enter the age of the patient in years:
Enter the number of days for the prescription:
The calculated dosage for Patient is mg times per day
They will need to take pills per day for a total of mg per day.
For days, the patient will need pills.
The total number of pills prescribed for all patients is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
