Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Language = Python Assuming that: Caffeine is absorbed into the body immediately. Once absorbed, 20% is eliminated from the body each hour. Write a

Programming Language = Python

  • Assuming that:

    • Caffeine is absorbed into the body immediately.

    • Once absorbed, 20% is eliminated from the body each hour.

  • Write a program that asks the user for the amount of coffee consumed, in milligrams (mg), and then compute (and output) the following:

    • The number of hours required until there is less than half of the caffeine left in the body

    • The amount of caffeine left in the body after 8 hours

  • Then, assuming that the person drinks a cup of coffee at 8 am and then drinks a cup of coffee at the end of each hour until 6 pm, compute and output the following.

    • How much caffeine will there be in the body at the end of the 10 hours?

  • A sample run would be as follows.

Enter the amount of caffeine in mg: 200

Less than half of it will be left after 4 hours.

The amount of caffeine left in the body after 8 hours: 33.55 mg

The amount remaining after 10 hours: 914.10 mg

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

Did Baer help Chase develop his idea?

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago