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
When are numbered lists generally used?
laiz [17]
<span>C. when listing items that have an order of priority </span>
4 0
3 years ago
Read 2 more answers
Create a Produceclass that hasan instance variable of type Stringfor the name, appropriate constructors, appropriate accessor an
Nezavi [6.7K]

Answer:

you suck

Explanation:

5 0
3 years ago
Suppose you have a 16-bit machine with a page size of 16B. Assume that any unsigned 16-bit integer can be a memory address. Also
irinina [24]

Answer:

2^11

Explanation:

Physical Memory Size = 32 KB = 32 x 2^10 B

Virtual Address space = 216 B

Page size is always equal to frame size.

Page size = 16 B. Therefore, Frame size = 16 B

If there is a restriction, the number of bits is calculated like this:  

number of page entries = 2^[log2(physical memory size) - log2(n bit machine)]

where

physical memory size = 32KB  which is the restriction

n bit machine = frame size = 16

Hence, we have page entries = 2^[log2(32*2^10) - log2(16)] = 2ˆ[15 - 4 ] = 2ˆ11

7 0
3 years ago
Write the code to create a variable score and assign it the value 0?​
Galina-37 [17]

Answer:

You can assign a value to a routine variable in any of the following ways:

Use a LET statement.

Use a SELECT INTO statement.

Use a CALL statement with a procedure that has a RETURNING clause.

Use an EXECUTE PROCEDURE INTO or EXECUTE FUNCTION INTO statement.

Explanation:

4 0
3 years ago
Help. serious help. the acc im using right now cant be ridded of by myself from being unable to have a pass. i need to contact a
anzhelika [568]

Answer:

Can't really help you... But you can try emailing support.

7 0
2 years ago
Other questions:
  • g The reciprocal Fibonacci constant ψ is defined by the infinite sum: ψ=∑n=1 [infinity] 1 Fn Where Fn are the Fibonacci numbers
    7·1 answer
  • An administrator working on a Windows Server 2016 Server Core installation needs to disable DHCP on all interfaces on the server
    12·1 answer
  • ___ is a career discipline focusing on helping companies use computer technology effectively.
    12·1 answer
  • What nondestructive testing method requires little or no part preparation, is used to detect surface or near-surface defects in
    7·1 answer
  • The ________ contains the central electronic components of the computer. select one:
    14·1 answer
  • For every $1 of deposits, the banks can increase ________________ by the value of the Money Multiplier.
    15·1 answer
  • Im getting hit offline can someone help or give me some advice
    6·1 answer
  • For current events, what type of sources would we use to learn about them?
    14·1 answer
  • How is information processed within a<br> motherboard between the hard drive, CPU and RAM,
    12·1 answer
  • the current food label has been in place for 20 years. the fda has proposed changes to this label for a variety of reasons, such
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!