1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetllana [295]
3 years ago
9

3.14 LAB: Input and formatted output: Caffeine levels A half-life is the amount of time it takes for a substance or entity to fa

ll 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.
Computers and Technology
1 answer:
nata0808 [166]3 years ago
8 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

double caffeineMg;

cin>>caffeineMg;

cout<<"After 6 hours: "<<fixed<<setprecision(2)<<caffeineMg/2.0<<" mg\n";

cout<<"After 12 hours: "<<fixed<<setprecision(2)<<caffeineMg/4.0<<" mg\n";

cout<<"After 24 hours: "<<fixed<<setprecision(2)<<caffeineMg/8.0<<" mg\n";

return 0;

}

Explanation:

  • Declare a variable for caffeine and take the input from user.  
  • Print the results by dividing the caffeine by relevant Half Life.
  • Use setprecision function to display the result up to 2 decimal places.
You might be interested in
Which key on the keyboard do you use when you copy using Drag and Drop? The Alt key. The Ctrl key. The Shift key. None of the ab
tamaranim1 [39]
CTRL key is used indeed
6 0
3 years ago
Read 2 more answers
Rainbow six siege imi da ecran negru.Ce sa fac?
Oduvanchick [21]
Mmmmmmmm check the internet
7 0
3 years ago
Question 5 of 5
Archy [21]

<u>Answer:</u>

<em>Sewage treatment Programs </em>

<u>Explanation:</u>

Sewage treatment programs are the right choice <em>because these are the source to create germs and if we understand how to be clean, most of the disease is avoided. </em>

<em>Drug regulation:</em> It is nothing but the continuous treatment of prolonged disease where pills needs to be taken regularly to protect patients from death or to avoid disease become more severe.

<em>Physical fitness campaign:</em> This concentrate on to how to keep bod fit through exercise and it does not deal with hygiene.

<em>Nutrition Education:</em> It’s a kind of protection mechanism where in-take of food is really concentrated to fight against germs.

5 0
4 years ago
How to make wrapped loops step by step?
diamong [38]

Answer:

what the heck? what kind of question is that

4 0
3 years ago
On the Sales worksheet, enter a date function in cell C8 to calculate the number of years the first representative has worked fo
alina1380 [7]

Answer:

See Explanation Below

Explanation:

The question is missing some details.

To answer this question, I'll make the following assumption

The assumption is that Cell B8 contains the date which a worker commence work in the organization.

Working base on the above assumption; in cell c8, type the following

= DATEIF(B8,TODAY(),"Y")

The above function follows the syntax below.

=DATEDIF (Start_Date , End_Date , Unit )

Where B8 = Start_Date = Date of work commencement

The function TODAY() returns today's date and it represent End_Date

The unit is represented by Y which means that the function is to return the number of years.

To copy the function to range C9:C20.

Select the cell C8

Rest your cursor in the lower-right corner so that it turns into a plus sign (+), like this:

Drag the fill handle down to C20

5 0
4 years ago
Other questions:
  • If you are planning to carry a large balance on your credit card, which of the following credit card features should you look fo
    7·2 answers
  • Create a java program that creates two files. Fill each file with 100 random integer numbers between 1 and 20.
    13·1 answer
  • A dns query failure is referred to a higher level domain name server under what condition
    7·2 answers
  • The SmoothWall open source firewall solution uses colors to differentiate networks. Which color indicates the private, trusted s
    9·1 answer
  • What is the primary benefit of using solid state storage
    7·1 answer
  • URGENT!!! If Pete selects the green square or little green camera icon on his camera dial, what mode is he selecting?
    15·1 answer
  • What protocol runs on port 23?!?!
    11·2 answers
  • All of these (except the ______) go unnoticed by the computer
    7·1 answer
  • How can using Prezi software for a presentation allow the presenter to better respond to audience needs?
    10·1 answer
  • PLEASE ANSWER THIS ASAP‼️
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!