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
What symbol do we use to assign a value to a variable or constant in algorithms?
jekas [21]

The symbol that we do use to assign a value to a variable or constant in algorithms is =.

<h3>What is used to assign a constant to a variable?</h3>

The const keyword is known to be one that tends to specifies a variable or object value that is known to be  constant.

In computing and computer programming, there are different kinds of variables as well as symbols that are used for different purposes.

Note that if you assign a variable, you need to use the = symbol and thus The symbol that we do use to assign a value to a variable or constant in algorithms is =.

Learn more about algorithms from

brainly.com/question/13800096

#SPJ1

3 0
1 year ago
What acronym describes networked devices that contain microcomputers but are not thought of as computing devices, such as refrig
vivado [14]
The acronym RFID (Radio Frequency Identification) describes networked devices that contain microcomputers but are not thought of as computing devices, such as refrigerators, automobile components, light bulbs, and industrial control devices. RFIDs are  battery-powered sensors that gather and transmit data to a reading device. Some sensor based technologies are  scanning electron microscopes, LiDAR,radar, GPS, x-ray, sonar, infrared and seismic.



5 0
3 years ago
A series circuit and identify how voltage is split up by each load in the circuit?
Vlada [557]

The same current flows through each part of a series circuit. The total resistance of a series circuit is equal to the sum of individual resistances. ... The voltage drop across a resistor in a series circuit is directly proportional to the size of the resistor. If the circuit is broken at any point, no current will flow.

4 0
3 years ago
What is the output for the following program?
Lelu [443]

Answer:

Output:

15

20

25

Explanation:

In first iteration value of num is 10. Condition is checked 10 is less than 21 so value of num is incremented by 5 and value 15 is printed than again condition is checked 15<21 so value of num is incremented again and 20 is printed. Again condition is checked 20<21. So 25 is printed. Then 4th time when condition is checked vakue of num is 25 and while loop condition becomes false because 25 is not less than 21 and program is terminated here.

6 0
2 years ago
Where does append add the new elements?
ZanzabumX [31]

Answer:

"Option 1: To the end of an array." is the correct answer.

Explanation:

The word "Append" means adding to the end of a document.

Appending means whatever new content is added, it is added at the end of the document or data structure.

Similarly,

Appending an array means adding new elements to the end of the array.

Hence,

"Option 1: To the end of an array." is the correct answer.

7 0
3 years ago
Other questions:
  • WILL GIVE BRAINLIEST! I'm doing a project at school. Does anyone have any good explanations for Digital Art? I need it to be at
    13·2 answers
  • In gaming, "rendering" refers to:
    12·2 answers
  • wHAT ARE THE 5 LAYERS in the internet protocol stack andwhat are the principal responsibilities of eack of theselayers.?
    12·1 answer
  • A typeface in which each character has the same width and is often used to display programming code is _
    8·1 answer
  • If the supply of computer engineers increases at the same time that the demand for these workers decreases, what would be the MO
    7·1 answer
  • For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
    12·1 answer
  • How to chnage email adresss on slate from tophat?
    13·1 answer
  • Which of the following is as result of division of Labour​
    5·1 answer
  • Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a
    10·1 answer
  • Identify the calculation performed by the following code.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!