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
12. Which of the following is CourseBit®? (1 point)
Annette [7]
<span>12. Which of the following is CourseBit®? 
</span><span>a leading Moodle™ development and hosting provider that focuses on highly customized systems
</span>
<span>13. In Blender®, which interface principle corresponds to the user interface that allows a user to view all options and tools at a glance with pushing or dragging editors around?
non-overlapping

Hope this helps.</span>
4 0
3 years ago
Which of the following things should you do first when planning your career?
Yanka [14]
Definitely D, if you want a career that will make you happy you should make a list of your job preferences and skills
8 0
3 years ago
Read 2 more answers
How do you change a automatic transmission
irinina [24]

Answer:

ohhh ok to all transactions.

6 0
3 years ago
A _____ is a tool that helps you research information on the Internet.
never [62]

a search engine is a tool that helps you reaserch information on the internet, because it is what you use to type in the info you want to learn more about

6 0
4 years ago
Given an array of integers check if it is possible to partition the array into some number of subsequences of length k each, suc
allochka39001 [22]

Answer:

Explanation:

Using Python as our programming language

code:

def partitionArray(A,k):

flag=0

if not A and k == 1:

return "Yes"

if k > len(A) or len(A)%len(A):

return "No"

flag+=1

cnt = {i:A.count(i) for i in A}

if len(A)//k < max(cnt.values()):

return "No"

flag+=1

if(flag==0):

return "Yes"

k=int(input("k= "))

n=int(input("n= "))

print("A= ")

A=list(map(int,input().split()))[:n]

print(partitionArray(A,k))

Code Screenshot:-

3 0
3 years ago
Other questions:
  • What was the first<br> 1:search engine<br> 2:website<br> 3:time the internet started
    6·1 answer
  • The purpose of an experiment is often based on ? A. new theories B. observations C. opinions of famous scientists D. beliefs of
    10·1 answer
  • . What is a "secondary dimension" in Google Analytics?
    9·1 answer
  • Does anyone take bca on plato
    11·1 answer
  • In which scenario would someone want to use the Paste Link option?
    7·1 answer
  • Explain how devices on a lan access resources in a small to medium-sized business network.
    15·1 answer
  • If your hood suddenly flies up you should turn on your hazard lights and continue driving. True or false?
    10·2 answers
  • True or False:<br><br> You can convert your PowerPoint presentation in web pages.
    8·2 answers
  • You need to implement a class that represents the state of a room or game section. The class will contain a room_id, a descripti
    15·1 answer
  • One advantage of a PAN​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!