Given caffeine amount in mg as input output the caffeine


Caffeine has a half-life of about 6 hours in humans. Given caffeine amount (in mg) as input, output the caffeine level after 6, 12, and 18 hours. If the input is 100, the output is:

After 6 hours: 50 mg

After 12 hours: 25 mg

After 18 hours: 12.5 mg

Note: A cup of coffee has about 100 mg. A soda has about 40 mg. An "energy" drink (a misnomer) has between 100 mg and 200 mg.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Given caffeine amount in mg as input output the caffeine
Reference No:- TGS02735123

Now Priced at $10 (50% Discount)

Recommended (91%)

Rated (4.3/5)