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
Flauer [41]
3 years ago
12

In Coral programming: A half-life is the amount of time it takes for a substance or entity to fall to half its original value. C

affeine 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 18 hours.
Ex: If the input is 100, the output is:

After 6 hours: 50.0 mg
After 12 hours: 25.0 mg
After 18 hours: 12.5 mg
Note: A cup of coffee has about 100 mg. A soda has about 40 mg. An "energy" drink (a misnomer) has between 100 mg and 200 mg.
Computers and Technology
1 answer:
viva [34]3 years ago
7 0

Answer:

Yes, it will be after 6 hours: 50 mg, after 12 hours: 25 mg, and after 18 hours: 12.5 mg

Explanation:

Remember coral is a functional programming language and follows Pythons functional programming paradigm. Remember Python supports functional, imperative as well as OOPS paradigm.

The function will be:

def void calcamtleft(int amt):

   integer a=6

   integer time=6

   integer i=1

   while amt> 0:

       amt=amt/2

       print("After"+time+"  hours:" +amt+"mg")

       i++

       time=a* i

Hence in first loop amt=100

new amt=100/2=50

After 6 hours: 50 mg ( this will be printed)

i will increment then, and time will be = 6 *2 =12

now input amt=50

new amt=50/2=25

After 12 hours 25 mg (this will be output)

i will increment then, and time will be = 6 *3 =18

now input amt=25

new amt=25/2=12.5

After 18 hours 12.5 mg (this will be output)

i will increment then, and time will be = 6 *4 =24

now input amt=12.5/2= 6.25

new amt=6.25/2= 3.125

After 24 hours 3.125 mg (this will be output)

i will increment then, and time will be = 6 *5 =30

now input amt=3.125

new amt=3.125/2= 1.5625

After 30 hours 1.5625 mg

And this will continue till amt>0

You might be interested in
Is this App for real?​
zhannawk [14.2K]

Answer:

Yeah?

Explanation:

I use it to do my homeworks lol

7 0
2 years ago
The local library dealing with a major computer virus checked its computers and found several unauthorized programs, also known
Dvinal [7]

Answer:

malware

Explanation:

7 0
2 years ago
Read 2 more answers
PLS HELP!! 50 Points! Will mark correct answer brainliest!!
Illusion [34]

Answer: C

Explanation:

That way she can have slides for her advance class and leave out slides that her normal class doesn’t need

5 0
3 years ago
Read 2 more answers
Which type of cell references are locked and NOT automatically updated when it’s copied
dsp73

Hi I would have to say B sorry if this answer is sucky but I'm trying my best to help you :D

4 0
2 years ago
A set of object that share a common structure and common behavior in database is called ​
Tcecarenko [31]
An Object Class. Hopefully this answer is right.
3 0
3 years ago
Other questions:
  • The North American Free Trade Agreement (NAFTA) among Canada, Mexico, and the United States is intended to _____.
    5·2 answers
  • HELP I don't understand this
    14·2 answers
  • 4. Extrusion tools in Blender® duplicate vertices while keeping the geometry connected with the original vertices. (1 point)
    7·1 answer
  • As with country citizenship, with digital citizenship comes _____.
    14·2 answers
  • While creating a sketch, what helps you identify positive and negative space?
    13·1 answer
  • 1) Using the density equation d=m/V: What is the density of a piece of metal with a mass o
    10·1 answer
  • Why is data processing done in computer?​
    14·1 answer
  • What is the FaFASA4caster used for
    10·1 answer
  • 5. Nadia wants to calculate the total interest, which is the total amount of the payments minus the loan amount. In cell F6, ent
    8·1 answer
  • Your network uses a network address of 137. 65. 0. 0 with a subnet mask of 255. 255. 0. 0. How many ip addresses are available t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!