3.11 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 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('{:.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 0/10 LAB 3.11.1: LAB: Input and formatted output Caffeine levels ACTIVITY

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
Section 3.1
learn.zybooks.comybook/VALDOSTACS1010Fall2021/chapter/3/pection/1
zyBooks
My library > CS 1010: Algorithmic Problem Solving home>
3.11: LAB: Input and formatted output: Caffeine levels
E zyBooks catalog e Help/FAQ e
3.11 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 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 ('{:.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.
318650.2047284gdey
LAB
3.11.1: LAB: Input and formatted output: Caffeine levels
0/10
АСTIVITY
-P Type here to search
%23
(?
84°F
brt sc
delete
backspace
R
SDE
pause
M.
ctrl
alt
Transcribed Image Text:Section 3.1 learn.zybooks.comybook/VALDOSTACS1010Fall2021/chapter/3/pection/1 zyBooks My library > CS 1010: Algorithmic Problem Solving home> 3.11: LAB: Input and formatted output: Caffeine levels E zyBooks catalog e Help/FAQ e 3.11 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 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 ('{:.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. 318650.2047284gdey LAB 3.11.1: LAB: Input and formatted output: Caffeine levels 0/10 АСTIVITY -P Type here to search %23 (? 84°F brt sc delete backspace R SDE pause M. ctrl alt
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
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