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
What feature preserves your open apps and data, but allows another user to log in to his or her own session of the same computer
Hitman42 [59]

A feature that preserves open apps and data while allowing another user to log in to his or her own session of the same computer is: switch user.

<h3>What is a computer?</h3>

A computer is an electronic device that is designed and developed to receive data from an end user in its raw form (input) and processes these data into an output that could be used for other purposes.

Generally, all computers are designed and developed with a feature called switch user, so as to preserve open software applications and data while allowing another user to log in to his or her own session of the same computer simultaneously.

Read more on computer here: brainly.com/question/959479

6 0
1 year ago
Which of the following should you consider when choosing a file format?
Mkey [24]

Answer:

C, the need for future access and digital preservation

Explanation:

On e2020

5 0
3 years ago
Read 2 more answers
You have stumbled on an unknown civilization while sailing around the world. The people, who call themselves Zebronians, do math
marshall27 [118]

Answer:

a. 6 bits

b. 1

Explanation:

Ans (a)

40 Characters need to be represent by binary coded Zebronian (BCZ) , So You will need 6 bits.

5 bits wold only give you 32 = 2 x 2 x 2 x 2 x 2 unique characters.

So 6 bits would allow you to represent 64 characters.

Ans(b)

BCD = Binrary Coded Decimal is very common in electronics, particularly it displays numerical data.

BCD Encodes each digit of a decimal number into 4 digit binary form.

Each decimal digit is indiviidually converted to oits binary equivalent

For Example : 146 , the decimal degits are replaced by 0001 , 0100 and 0110 respectively

Addition

1 0 = 10 is binary value of 2 2

+1 1 = 11 is binary value of 3 + 3

---------- -----------

1 0 1 5 Ans

Subtraction

1 1= binary value of 3 3

- 1 0 = binary value of 2 - 2

--------- -----------

0 1 1 Ans

6 0
3 years ago
The function below takes two numeric parameters. The first parameter specifies the number of hours a person worked and the secon
Triss [41]

Answer:

def calculate_pay(total_worked_hours, rate_per_hour):

   if total_worked_hours > 40:

       return (40 * rate_per_hour) + ((total_worked_hours - 40) * 2 * rate_per_hour)

   else:

       return total_worked_hours * rate_per_hour

Explanation:

  • Create the calculate_pay function that takes 2 parameters.
  • Inside the function check whether the total_worked_hours is greater than 40 and then return the pay by calculating with the help of formula for work over 40 hours.
  • Otherwise return the pay by multiplying the total_worked_hours with rate_per_hour.
6 0
3 years ago
Edhesive 6.8 lesson practice answers
FromTheMoon [43]

Answer:

1.) 25 ; 15 ; 15

2.) 50 ; 15 ; 50

Explanation:

In the first function written :

The variable val was initially decaled or assigned a value of 25 and that was what was printed first.

However, after the example function was written, the val variable was finally assiagned a value of 15 within the function. However, it was also declared that the global variable takes uonthe val value. Hence, the val variable initially assigned a value, of 25 changes to 15 globally.

For the second code :

From the top:

Val was assigned a value of 50 ;

Hence,

print(val) gives an output of 50

Within the function definition which prints the value of val that is assigned a value of 25 within the function.

Since tbe global variable isnt reset.

Printing Val again outputs 50;since ito is outside the function.

6 0
2 years ago
Other questions:
  • ____ deals with ensuring that data is protected against unauthorized access, and if the data are accessed by an authorized user,
    10·1 answer
  • 1.Characters archetypes are typical characters that represent universal patterns of human or human roles. (True or false)
    14·1 answer
  • Trading your bicycle for a snowboard exemplifies ?
    15·1 answer
  • Which term describes the situation wherein a jury fails to reach a unanimous verdict? A occurs when a jury cannot reach a unanim
    14·1 answer
  • Robert's employer has agreed to pay half the tuition for Robert to complete his college degree. This benefit is known as what?
    7·2 answers
  • Make a list of five primary raw materials, for each one, indicate and industrial material that is created from it
    10·2 answers
  • Anyone know how to delete it in my laptop
    10·1 answer
  • By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway)
    11·1 answer
  • Write a program that asks the user for the name of a file. The program should display the contents of the file with each line pr
    13·1 answer
  • 5. What skill is unique to reading online?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!