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
To ensure rapid recovery and security of data, backup data should be ________.
Nataly [62]

Answer:B kept at a secure location at the facility

Explanation:

8 0
3 years ago
To copy the formatting of selected text to another place in the document use _____.
ANEK [815]
To copy the formatting of selected text to another place in the document use the paintbrush AKA. Format painter
7 0
3 years ago
In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key r
rodikova [14]

Answer:

The answer is "Option A".

Explanation:

A comprehensive collection of principles, guidelines, proposals, and studies on information and information systems privacy and safety are produced and carried out in the NIST publications.

  • The FIPS management standards for federal information and security laws contain various technical reporting sequences.
  • This process takes place after a plan is identified, reviews are carried out and risk analysis is performed.
8 0
3 years ago
Describe the nodes in a 2-4 tree.
aivan3 [116]

Answer:

The node of the 2-4 tree can have at most three values.

There are basically 3 types of nodes in the 2-4 tree which are as following:-

  1. 2-Node.
  2. 3-Node.
  3. 4-Node.

2-Node:-It contains 1 data element and two child pointers.

3-Node:-It has 2 data elements and three child pointers.

4-Node:-It has 3 data elements and four child pointers.

There is also leaf node which can contain 2,3 or 4 data elements but has no child pointers.

4 0
3 years ago
What is the default extension of Q Basic program file? ​
KonstantinChe [14]

Answer:

Bas

Files written with QBASIC must be run using the program and have the "bas" file extension.

Hope this helps

#Carryonlearning

8 0
2 years ago
Other questions:
  • Choose all statements that identify the benefits of programming design.
    10·2 answers
  • Give some examples of CyberCrime
    9·1 answer
  • Difference between entropy and enthalpy is
    9·1 answer
  • In real-world environments, risks and their direct consequences will most likely span across several domains. However, in the la
    12·1 answer
  • Leah’s computer is connected to the network most of the time. Once, she noticed few of her files with sensitive data were missin
    8·1 answer
  • Write a program that uses an initializer list to store the following set of numbers in an array named nums. Then, print the arra
    10·2 answers
  • Write a program that accepts the lengths of three sides of a triangle as an input from the user: A, B, C
    13·1 answer
  • What is a spreadsheet​
    12·1 answer
  • Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
    15·2 answers
  • Question 1 (1 point)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!