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
The part of the computer that contains the brain, or the central processing unit, also knows as the
Kamila [148]
What other name are you looking for? or pleases rephrase the question, You already have the answer in your question.




The part of the computer that contains the brain is the CPU, or Motherboard, Microprocessor. if that's what you're asking. I don't know another word for the brain of the computer.




Hope that helps!!!
7 0
3 years ago
He should identify his various
joja [24]

Answer:

false, that shouldn't be a a priority to identify if they are or not.

Explanation:

3 0
3 years ago
You need to install an operating system on a computer that will be sharing files for the company employees. You estimate there w
UkoKoshka [18]

The operating system that is ideally suited for this machine that will be sharing files for the company employees with an estimated of as many as 15 users accessing these files at one time is Windows Server 2003 Standard Edition.

This operating system is best suited to handle the load of 15 concurrent users.

4 0
3 years ago
Java uses the key word _____________ to indicate that one class inherits from another class
Yuri [45]
Extends






-----------------------------
4 0
3 years ago
What symbol represents “and” in JavaScript???
Anvisha [2.4K]

Answer:

&& represent "and" in Javascript. Hence, if you want to make use of and in Javascript then you need to make use of && operator, as this in Javascript means and.

As an example:

if (a && b) {

// code to be executed

}

Above if a and b are equal then the code will be executed or else part will be executed.

Explanation:

Please check the answer section.

5 0
3 years ago
Read 2 more answers
Other questions:
  • A security administrator is analyzing a user report in which the computer exhibits odd network-related outages. The administrato
    13·1 answer
  • Which option best describes the cheapest way to file your federal income taxes?
    5·1 answer
  • What are MS Word's default tabs?
    5·2 answers
  • The equation x + y2-4x+2y=b describes a circle.
    8·1 answer
  • Can someone buy me eddie van der tabs???
    13·1 answer
  • Assume you have created a program that has the user enter an email address of the form: <a href="/cdn-cgi/l/email-protection" cl
    11·1 answer
  • (TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
    8·1 answer
  • Which computer application is an example of a DBMS?
    8·1 answer
  • To generate a series of first ten counting number of algorithm​
    9·1 answer
  • GUYS I NEED HELP!!!! Every time pc resets it clears all of my data files and content how do you fix this. Pls help
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!