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
svp [43]
3 years ago
6

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-lif

e of about 6 hours in humans. Given caffeine amount (in mg) as input, output the caffeine level after 6, 12, and 24 hours. Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements.
Computers and Technology
1 answer:
Leokris [45]3 years ago
3 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:

  • Take the caffeine as input from user.
  • Calculate by dividing this value with relevant half life.
  • Use setprecision(2) to display 2 digits after decimal point.
You might be interested in
A document may wordwrap differently depending on the type of printer being used.
Naddika [18.5K]

I believe the answer is true :)

7 0
3 years ago
Effective character encoding requires:
Dvinal [7]

To answer your question the answer would be B compatible browsers

8 0
3 years ago
PLEASE help me RIGHT NOW!!!!!!!!! I will give a Brainly to anyone who helps me!
dybincka [34]
I am deeply sorry for the experience that you have received, I am disappointed in myself for letting this happen. If it would be possible I would like to make it up to you. Again, I am deeply sorry that this happened. 
Sincerely *enter full name*

I am not sure if you have any multiple choice options but I hope this works xx
8 0
3 years ago
Treat others the way
Andreyy89

Answer:

C.

Explanation:

But shi.it i dont treat ppl good when they disrespecting me or my friends i be putting them in hush mode.

3 0
3 years ago
Read 2 more answers
A seller buys and item from a manufacturer for 9,500
andriy [413]

we need more info

so we can answer the question

8 0
4 years ago
Other questions:
  • When computer manufacturers overcame the enormous 13,000 Chinese character barrier by creating a workable keyboard through voice
    15·1 answer
  • What is malware short for?
    13·2 answers
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • Which method do software testers use to isolate new code from the rest of the network during the test stage of the software deve
    15·1 answer
  • How does cryptocurrency exchange software works?
    14·1 answer
  • . How do you find and remove files whose names contain embedded spaces? What would the Linux command(s) be?
    12·1 answer
  • Mô tả những lợi ích của việc sử dụng đa xử lý không đồng nhất trong một hệ thống di động
    8·1 answer
  • How many combinations of 1s and Os can we make with 6 place values?
    12·1 answer
  • Which approach to bandwidth usage consumes all of the available frequencies on a medium to transmit data
    7·1 answer
  • What web browser feature would be particularly useful when using public computers?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!