Question: I need a program created using Java. Details below. The first part would just be to create a basic program that would be able to
I need a program created using Java. Details below. The first part would just be to create a basic program that would be able to do what it says in Setup of Program.
BACKGROUND FOR PROGRAM
The user wants a program to track how much medicine is in a patients body. Concentration is typically an amount in units per liter.1 But the user doesnt need something so precise. The formula to use is simpler. It is the total amount of medicine left from each dose at a given time.
A dose is when the patient takes the medicine and the size. Each time the patient takes a dose, the medicine follows a concentration formula. The first part of the formula is the rise. This rise starts right after the patient takes the medicine. It is how the medicine increases in the body. The second part of the formula is the fall. This fall dictates how the amount of medicine decreases in the body.
For each dose, the amount of medicine in the body rises in a linear fashion. It starts at zero. Then it steadily increases until a peak. That peak happens at Tmax. At that time, the amount of medicine in the body is equal to the size of the dose. If, for example, a patient takes 20 mg at noon and the Tmax is 1 hour, then at 1 hour, the patients body has the full 20 mg of the medicine.
Once the amount of medicine reaches Tmax, it begins to fall. The half-life is the amount of time the concentration needs to decrease by half. Thus, if the half-life is two hours and the largest concentration is 20 mg, then two hours after Tmax, concentration is at 10 mg. Four hours after Tmax, concentration is at 5 mg. Six hours after Tmax, concentration is at 2.5 mg, and so on.
SETUP OF PROGRAM
The user expects to initially set three parameters. The parameters are the name of the medicine, the Tmax, and the half-life.
The user wants to enter information about doses. The input is in two forms. The first is just the amount of the medicine. The second is the amount and the time the patient takes it. If the input is in the first form just the amount, the software must assume that the patient is taking the medicine now. The dose time is thus the current time. But if the input is in the second form includes both amount and time, the software must use the inputted time, not the current time.
The user wants to do more than just enter information about the medicine and when the patient takes a dose. Other functionality includes listing all doses, removing a dose, clearing all doses at once, displaying current concentration amount, displaying concentration amount at a specified time, saving all doses when the program closes, and optionally loading saved doses when the program reopens.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
