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
To avoid legal issues and set clear guidelines and expectations for employees, employers should put which of the following in pl
Mademuasel [1]

Answer: social media policy

Explanation:

In order to avoid legal issues and also set clear guidelines and expectations for the employees in an organization, it is required that employers should put a social media policy in place.

A social media policy refers to a document which outlines how an organization and the employees will behave and conduct themselves online. This helps to checkmate and curtail the activities of the employees so that there won't be a detrimental effect on the organization.

8 0
3 years ago
In which area is composing for games different from composing for movies?
kondaur [170]

Answer: royalties earned

Explanation:

In areas such as the looping scores, temp tracks and adaptive scores, there are similarities when composing for games and when composing for movies.

The area where there is difference when composing for games and composing for movies is the royalties earned. The interest that is earned on royalties for both cases are different.

8 0
3 years ago
What is Activation code for wwe 2k20 ​
Arte-miy333 [17]
Shouldn’t you get that in your email when you sign up.
5 0
3 years ago
Read 2 more answers
If a firm puts Internet-facing servers directly in the Internet, they are exposed to threats of attack from anywhere in the worl
djverab [1.8K]

Answer:

True.

Explanation:

If a firm puts servers that are internet facing directly on the internet then the servers are exposed to external attacks and these attacks can be from anywhere in the world.

The server becomes vulnerable or unsafe and attackers can attack and can manipulate or tamper the server code from anywhere in the world.

8 0
3 years ago
Advantages of ASCII over EBDCDIC​
KiRa [710]
<h3>Efficiency. Moreover, the same character in ASCII requires 7 bits, but EBCDIC required 8 bits. Therefore, ASCII is more efficient than EBCDIC.</h3>

7 0
3 years ago
Other questions:
  • . Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    12·1 answer
  • You open a web page and log into your email. The traffic travels over many routers. What protocol will the routers use to determ
    6·1 answer
  • identify three ways we use analog and digital signals in our everyday lives. Describe how radio telescopes are used to explore s
    7·2 answers
  • When designing a suitable and safe flexibility training program, you should set reasonable and appropriate goals depending on wh
    15·1 answer
  • How do you use bold text?
    5·2 answers
  • What is the name given to a collection of related fields such as ID number,name and address?
    12·1 answer
  • Who distributes IP Address?
    10·1 answer
  • Friday Night Funkin Fans, does this count as a leak if I share it?
    13·2 answers
  • Which of the following statements concerning a short in a series circuit is true?
    12·1 answer
  • Which of the following would be considered a subtopic for a mind map?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!