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
Is a protocol that allows users to log on to and access a remote computer?
kompoz [17]
The answer is yes I hope this help ya out

6 0
3 years ago
When determining the amount of RAM necessary for a computer you wish to purchase, what should you consider?
Igoryamba

Answer:

"The type of the software which a user wants to use" is a consideration point for the amount of ram while purchasing the computer system.

Explanation:

  • The Ram is primary memory, which is used when the system is in on mode. When there is less amount of Ram, then the user of the computers can not able to run multiple programs or runs that type of program which consumes more memory.
  • And if there is a high amount of RAM memory, then the user can run multiple programs at the same time or can run that program which takes more memory.
  • So when any user wants to decide about the Ram, then he can by deciding the type of software, which he wants to use. How much that software can use the memory.
8 0
3 years ago
I need help<br> plsssssssss
Misha Larkins [42]
The factorial of 4 is 24
4 0
3 years ago
What is ransomware<br>я​
Novosadov [1.4K]

Answer:

Ransomware is malicious software that infects your computer and displays messages demanding a fee to be paid in order for your system to work again. It has the ability to lock a computer screen or encrypt important, predetermined files with a password.

Explanation:

:)

5 0
2 years ago
What is the output of this program?
Charra [1.4K]

Answer:

20

Explanation:

assuming the print statement is not indented, the program effectively calculates 2+5+6+7.

The range(...) is <em>excluding </em>the end value (8 in this case).

3 0
3 years ago
Read 2 more answers
Other questions:
  • SOMEONE PLEASE HELP ASAP!!
    14·2 answers
  • Create a detail report that will display all SCR courses in alphabetical order, with the course name and the instructor name in
    5·1 answer
  • Write a method called makeLine. The method receives an int parameter that is guaranteed not to be negative and a character. The
    11·1 answer
  • The main disadvantage of using this device is its negative impact on network performance,resulting from the fact that any incomi
    10·1 answer
  • Provide a few examples of how cryptography actually secures data.
    8·1 answer
  • Many major employers routinely monitor the performance of their employees through the computers and telephones they use. Employe
    12·1 answer
  • When an expression containing a ____ is part of an if statement, the assignment is illegal.
    14·2 answers
  • What will be the results from running the following code?
    5·1 answer
  • Do u have all the subjects​
    12·2 answers
  • The federal communications commission oversees the programming of which entities?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!