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
avanturin [10]
3 years ago
10

A half-life is the amount of time it takes for a substance or entity to fall to half its original value. Caffeine has a half-lif

e of about 6 hours in humans. Given caffeine amount (in mg) as input, output the caffeine level after 6, 12, and 18 hours. Do not type your input into the optional input box below, rather, input in response to the prompts in the output terminal window (prompts are given to you in the program template). Use a string formatting expression with conversion specifiers to output the caffeine amount as floating-point numbers. Ex: If the input is 100, the output is: After 6 hours: 50.000000 mg After 12 hours: 25.000000 mg After 18 hours: 12.500000 mg
Computers and Technology
1 answer:
Ivan3 years ago
5 0

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

 // variable

float n;  

cout<<"Enter the initial value:";

//Read the input from the user  

cin>>n;

//Declare variables for storing values at 6, 12 and 18 hours

float hours_6, hours_12, hours_18;  

//Set precision level of floating point number

cout << fixed;

    cout << setprecision(6);

 //calculate values at 6, 12 and 18 hours

hours_6 = n / 2.0;

hours_12 = hours_6 / 2.0;

hours_18 = hours_12 / 2.0;

//display the output

cout<<"After 6 hours: "<<hours_6<<"mg"<<endl;

cout<<"After 12 hours: "<<hours_12<<"mg"<<endl;

cout<<"After 18 hours: "<<hours_18<<" mg"<<endl;

return 0;

}

Explanation:

Read an input from the user. Set the precision to 6 for displaying the result up to 6 decimal places. The first half life at 6 hours can be calculated by dividing the input by 2. The half life at 12 hours can be found out by dividing the half life value at 6 hours by 2. Similarly at 18 hours, we find the half life value by dividing the half life value at 12 hours by 2.

Output:

Enter the initial value:100                                                                                                

After 6 hours: 50.000000 mg                                                                                                

After 12 hours: 25.000000 mg                                                                                              

After 18 hours: 12.500000 mg  

You might be interested in
A device has an IP address of 10.1.10.186 and a subnet mask of 255.255.255.0. What is true about the network on which this devic
lawyer [7]

Answer:

Only the last number of each IP address will be unique

Explanation:

Subnet Mask is used to identify the two parts of the IP address. One is the network part that should be same for one network, and other is host part that will vary with number of computer or devices that are connected to the network.

Subnet mask is 32 bit address that are divided in 4 equal parts of 8 bits. Each 8 bit converted to decimal by varying different bits to generate 256 different decimal number combinations. It means we can vary the address range between 0 to 255. So If any 8 bit portion is 255 that means, in this section we cannot add host address.

<u>For Example</u>

In given case,

Subnet Mask = 255.255.255.0

That means first three portions are fixed and has been allocated for network part.  

The forth portion is 0 that means we can change this portion in IP address up to 255 different addresses.

So the IP address that is given can be vary as:

10.1.10. 186

10.1.10 This portion is network portion, this cannot be vary.

only the number 186 is the unique address that is particularly assigned to the devices and is vary between 0 to 255.

8 0
3 years ago
The standard name of the java compiler is
Natalija [7]
The standard name of the java compiler is javac.
3 0
3 years ago
Imagine you plan to send 5 petabytes data from New York to San Francisco. You have two choices: (1) transfer data using your 200
Taya2010 [7]

Answer: UPS.

Explanation: Since there are around 1 Billion Megabytes in 1 Petabyte, 5,368,709,120 / 200 Mbps = 26,843,545 Seconds.

26,843,545 seconds = 310 Days.

UPS should be faster.

I hope I helped you out!

8 0
3 years ago
You run anti-virus software on your computer; however, you are experiencing symptoms that may be caused by a virus. What should
garik1379 [7]

Reinstall the operating system.

7 0
3 years ago
Read 2 more answers
Which of the following best describes why Earth’s atmosphere can support life on Earth?
Juliette [100K]
C. is very thin, thus allowing harmful gases to escape from it
4 0
3 years ago
Other questions:
  • Bunch of points!!!!!!! help pls
    11·2 answers
  • Which of the following describes the ways organisms are interconnected through their feeding patterns?
    10·2 answers
  • Which tab in Microsoft Word provides access to the backstage view?
    8·2 answers
  • All margins of a report are _____ inch. *<br><br> 1<br> 2<br> 3<br> 4
    5·1 answer
  • In Excel you insert a comment in a worksheet by using the ____ tab on the Ribbon.
    10·1 answer
  • A business letter is not written:
    6·1 answer
  • Create a flowchart to print numbers from 1 to 100
    7·1 answer
  • 1) "Information systems are revolutionizing the way businesses function in the 21st century," Do you agree or disagree with this
    5·1 answer
  • The process by which information gets into memory storage is
    10·1 answer
  • Which program will have the output shown below?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!