A half-life is the amount of time it takes for a substance or entity to fall to half its original value. 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 24 hours. Use a string formatting expression with conversion apecifiers to output the caffeine amount as floating-point numbers. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value)) Ex: If the input is: 100 the output is: After 6 hours: 50.00 mg After 12 hours: 25.00 mg After 24 hours: 6.25 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. 312198 2042412.qx3zgy7

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Help me figure this out. Thanks
PTER AREVIEW OU
O Browsin X
zy Section X
O Safe Sea X
O how to
C Sign In
Content x
O what ar
A Read Al x
h OnTarge x
ead alo
CHCCCTI110Fall2021/chapter/9/section/14
OnTarget Login Steam
Intel zy zybooks © Google W Python - List Metho.
W Python
costella.green@yah.
O Self Service FTCC
b, Programming, Database Foundation home>
matted output: Caffeine levels
9.14 LAB: Input and formatted output: Caffeine levels
A half-life is the amount of time it takes for a substance or entity to fall to half its original value.
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 24 hours. Use a string formatting expression with conversion
apecifiers to output the caffeine amount as floating-point numbers.
Output each floating-point value with two digits after the decimal point, which can be achieved as
follows:
print('{:.2f}'.format(your_value))
Ex: If the input is:
100
the output is:
After 6 hours: 50.00 mg
After 12 hours: 25.00 mg
After 24 hours: 6.25 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.
312198.2042412 qx3zqy7
LAB
9.14.1: LAB: Input and formatted output: Caffeine levels
ACTIVITY
0/ 10
W
Transcribed Image Text:PTER AREVIEW OU O Browsin X zy Section X O Safe Sea X O how to C Sign In Content x O what ar A Read Al x h OnTarge x ead alo CHCCCTI110Fall2021/chapter/9/section/14 OnTarget Login Steam Intel zy zybooks © Google W Python - List Metho. W Python costella.green@yah. O Self Service FTCC b, Programming, Database Foundation home> matted output: Caffeine levels 9.14 LAB: Input and formatted output: Caffeine levels A half-life is the amount of time it takes for a substance or entity to fall to half its original value. 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 24 hours. Use a string formatting expression with conversion apecifiers to output the caffeine amount as floating-point numbers. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value)) Ex: If the input is: 100 the output is: After 6 hours: 50.00 mg After 12 hours: 25.00 mg After 24 hours: 6.25 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. 312198.2042412 qx3zqy7 LAB 9.14.1: LAB: Input and formatted output: Caffeine levels ACTIVITY 0/ 10 W
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

use the following code:

print(f'{your_value:.2f}')

A half-life is the amount of time it takes for a substance or entity to fall to half its original value. 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 24 hours. Use a string formatting expression with
conversion specifiers to output the caffeine amount as floating-point numbers.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print(f'{your_value:.2f}')
Transcribed Image Text:A half-life is the amount of time it takes for a substance or entity to fall to half its original value. 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 24 hours. Use a string formatting expression with conversion specifiers to output the caffeine amount as floating-point numbers. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print(f'{your_value:.2f}')
Solution
Bartleby Expert
SEE SOLUTION
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education