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
Lesson 3: Wrapping Up Unit 6
GrogVix [38]

Answer:

A visual representation of colors arranged according to their hues, or the chromatic relation they share

Explanation:

7 0
3 years ago
Read 2 more answers
You are given the IP Address of 193.103.20.0 /24 and need 50 Subnets. How many hosts per network, and total networks do you get
lora16 [44]

Answer:

Hosts per network = 2

Total networks once subnetted = 64

Explanation:

7 0
3 years ago
What will be the value of bonus after the following code is executed?
pashok25 [27]

Answer:

Option (B) i.e., 500 is the correct option to the following question.

Explanation:

The following option is correct because here, firstly they defined two integer data type variable i.e., "bonus" and "sales" and assign value to the variable "sales" i.e., 6000 then, the set the if-else if statements to check the "bonus" and pass conditions is if the sales is less than 5000 then bonus is equal to 200 otherwise if the sales is less the 7500 then bonus is equal to 500 otherwise if the sales is less the 10000 then bonus is equal to 750 otherwise if the sales is less the 2000 then bonus is equal to 1000 otherwise bonus is equal to 1250.

So, according to the following conditions sales is less than 7500 because sales is equal to the 6000 that's why the following option is correct.

6 0
3 years ago
1. What do you think of the use of Moore’s Law to hypothesize a timeframe for the origin of life?
KATRIN_1 [288]

Answer:

Moore's Law refers to Moore's perception that the number of transistors on a microchip doubles every two years, though the cost of computers is halved. Moore's Law states that we can expect the speed and capability of our computers to increase every couple of years, and we will pay less for them. Another tenet of Moore's Law asserts that this growth is exponential.

5 0
3 years ago
Read 2 more answers
HELP AS SOON AS YOU CAN!!! what word best describes an appropriate study area?​
Basile [38]

Answer:

Quiet

Explanation:

Really anywhere thats quiet you can just sit down and study. For example a library

6 0
3 years ago
Other questions:
  • What are the purpose of Keyframes,
    11·1 answer
  • How do you change exposure to allow for greater DoF
    10·1 answer
  • To ease giving access to network resources for employees, you decide there must be an easier way than granting users individual
    9·1 answer
  • How does human error relate to security risks
    5·1 answer
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • Name the three basic storage device of a computer​
    6·2 answers
  • What do flowcharts communicate to programmers ?
    10·1 answer
  • How does a modem work​
    13·1 answer
  • What kind of goal does ariel set when he works to graduate from high school in four years? short term long term normative fantas
    9·1 answer
  • r packages include sample datasets. they also include reusable r functions and documentation about how to use the functions. Tru
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!