-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrugPotency.java
More file actions
25 lines (19 loc) · 855 Bytes
/
DrugPotency.java
File metadata and controls
25 lines (19 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.text.DecimalFormat;
public class DrugPotency {
public static void main(String[] args) {
double loosePercnt = 0.04, effectivnssFull = 100, effectivnssHalf = 50;
int month = 0;
DecimalFormat numForm = new DecimalFormat();
System.out.print("\nMonth: " + month);
System.out.print("\t\t\teffectiveness: " + numForm.format(effectivnssFull));
while (effectivnssFull > effectivnssHalf) {
effectivnssFull -= effectivnssFull * loosePercnt;
System.out.print("\nMonth: " + ++month);
if (month < 10)
System.out.print("\t\t\teffectiveness: " + numForm.format(effectivnssFull));
else
System.out.print("\t\teffectiveness: " + numForm.format(effectivnssFull));
}
System.out.print(" DISCARDED");
}
}