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
gavmur [86]
3 years ago
12

Write a program that estimates the approximate number of times the user’s heart has beat in his/her lifetime using an average he

art rate of 72 beats per minute and estimates the number of times the person has yawned in his/her lifetime using an average of 5 yawns per day. The program should have two functions, heartbeats(age) and yawns(age), that take age in years as an input parameter and returns the estimated number of heartbeats and the number of yawns, respectively. In your computation ignore the leap years.
Computers and Technology
1 answer:
kondor19780726 [428]3 years ago
7 0

Answer:

The code snippet given in python for resolve this question is the following:

import datetime

currentYear = datetime.date.today().year

def heartbeats(age):

 av = 72 * 60 * 24 * 365

 for i in range(currentYear - age - 1, currentYear + 1):

   if is_leap(i):

     av += av

   else:

     pass

 return av

def yawns(age):

 av = 5 * 365

 for i in range(currentYear - age - 1, currentYear + 1):

   if is_leap(i):

     av += av

   else:

     pass

 return av

def is_leap(year):

 if (( year%400 == 0)or (( year%4 == 0 ) and ( year%100 != 0))):

   return True

 else:

   return False

print("Heartbeats: {}, yawns: {}".format(heartbeats(23),yawns(23)))

Explanation:

We have defined 3 functions:

  • def heartbeats(age): Takes the average  heartbeats of a year and sum a acumulative varible(av) when the year is not leap. Return av value.
  • def yawns(age): Takes the average yawns of a year and sum a acumulative variable(av) when the year is not leap. Return av value.
  • def is_leap(year): Return true if is a leap year and false if not.
  • print("Heartbeats: {}, yawns: {}".format(heartbeats(23),yawns(23))). Print the output of the called functions(heartbeats and yawns) for the inserted age (23).
You might be interested in
Which terms describes Benito Mussolini’s form of government
slega [8]
The political system that describes Benito Mussolini’s form of government would be totalitarian.Hope this answers the question:)
5 0
3 years ago
Read 2 more answers
The way a particular application views the data from the database that the application uses is a.
masha68 [24]

The way a particular application views the data from the database that the application uses is a sub-schema.

<h3>What is Database?</h3>

A Database may be defined as a process of collecting data and information that is principally assembled for quick search and recoupment by a computer.

The sub-schema is the reasoning elucidation of that section of the database which is applicable and accessible to a specific application. This type of database is common to two or more applications.

Therefore, the sub-schema is the way through which a particular application views the data from the database that the application uses.

To learn more about Database, refer to the link:

brainly.com/question/26096799

#SPJ4

4 0
1 year ago
In the function below, use a function from the random module to return a random integer between the given lower_bound and upper_
sladkih [1.3K]

Answer:

import random

def ran(lower_bound, upper_bound):

   return random.randrange(lower_bound, upper_bound)

print(ran(3, 8))

Explanation:

The programming language used is python.

Modules are imported using the import keyword. In the first line the random module is imported.

A function ran is defined and it has two parameters, lower and upper bound that wll be passed to the function from random module.

The random module is a module that is used to generate random numbers, it is a very common module in programming, some of the popular functions in the module are random.randint and random.randrange. There are several other functions but these are the most common. the randint(a, b) takes two arguments and returns a random integer between the two arguments.

randrange(start, stop, step); It can take up to three arguments but has only compulsory argument that must be given for it not to generate an error and that is the stop.

when only the stop is defined, it assumes the start as zero and creates a range from 0 - stop and returns a random number within that range.

When start and stop arguments are given, it returns a number within the range of start - stop.

Start and stop must be given for there to be a step, if the step is given, it means the array containing the range of numbers will skip a step after each number.

The program makes use of the random.randrange(start, stop) and the upper and lower bounds are passed as its arguments.

Finally, the function is called and its return value is printed to the screen.

6 0
3 years ago
How would you experiment to find out how much water this plant type needs for optimal growth
dem82 [27]
Plant Growth Experiments The instructions below outline a protocol for conducting plant growth experiments in the laboratory. You may want to make adaptations for use in a greenhouse or outdoors. Purpose: To determine the effect of compost on plant germination and growth. Materials pots or planting trays compost soil seeds light source (sunlight or artificial lighting) Procedure 1. Design your own experiment. There are many possibilities--a few ideas are listed here, but the variations are endless: Test various combinations of soil and compost on plant growth. For example, you might wish to dig a soil sample from your school yard and mix it with various amounts of finished compost for planting experiments. (Natural soil is better than prepackaged potting soils for experiments such as this because the potting mixes are formulated for optimal plant growth and already contain significant amounts of compost or humus.) Another possibility is to mix your own potting soil by using vermiculite, sand, and compost. Creating several mixtures using the same percentages but different types of compost is a good way of comparing the influence of the various types of compost on plant growth. For example, you could compare compost at various levels of maturity, compost created using different mixtures of organic wastes, or vermicompost versus compost created in a thermophilic system. If you are interested in investigating the effects of compost tea on plant growth, you could fill the pots with a sandy soil or potting medium such as vermiculite, then use compost extracts for watering. 2. Whatever type of experiment you choose, make sure that you design your experiment to include replicates of the various treatments. For example, your design might look like the following: Treatment (% soil/% compost) # Flats (with 6 plants in each) # Plants 100% compost 3 18 25/75 3 18 50/50 3 18 75/25 3 18 100% soil 3 18 3. Plant your seeds, water them, and place them in a well-lit location. Many type of seeds will work, but radish or lettuce are often chosen because they grow quickly. Melon seeds are sensitive to fungal diseases, and thus they provide a sensitive indicator of whether fungi have been killed through heating or curing of the compost. 4. Keep all the pots in the same setting to minimize any variation in temperature, lighting, pests, and other environmental factors. Even when the environmental conditions are kept as constant as possible, it is a good idea to randomize the grouping of plants rather than placing all the plants that are receiving the same treatment together in one group. This helps to further minimize the effect of any environmental differences. 5. Record on a daily basis the number of seeds that have germinated, plant growth, and observations about plant health such as color, vigor, or damage due to pests and diseases. You can decide what measurements to use as indicators of plant growth; possibilities include plant height, number and size of leaves, and dry weight of the entire plant at the end of the experiment. (For dry weight, weigh the plant after drying in a 105C oven for 24 hours.) Analysis and Interpretation 1. Graph germination rates and plant growth over time for the different treatments. Also, determine the mean number of seeds germinated and mean size or mass of the plants at the end of the experiment. Compare average germination rates, plant growth, and health for the different experimental treatments. Based on your experiments, what was the optimal potting mix for plant germination? For plant growth? For plant health? 2. Some things may have gone wrong in your experiments. For example, you may have over-watered your plants, causing them all to die from fungal infection regardless of the treatment. Or you may have taken measurements only on plant height, and later decided that measuring the number of leaves and length of the main stem would have given better information. These types of problems are normal and can be used as a basis for redesigning the experiment. How might you change your experimental design if you were to carry out another set of growth experiments? 3. You may not find any differences between the treatments. Or, you may discover that the plants grown without compost did best. If this is the case, it may be difficult to determine whether the compost had no effect, or you did something wrong. The tendency is to assume the compost really has an effect and to attribute insignificant or negative results to experimental mistakes. However, the interpretation of results should not be biased by your predictions or preconceived ideas about the way experiments will turn out. Often unexpected results lead to important insights and questions. Maybe your compost is of poor quality, or maybe the plant species you chose grows well in poor soils. Explore all the possibilities for explaining your results with an open mind, through discussions and new experiments.
6 0
3 years ago
The HR department of a company has to send an email notifying an employee of a work performance issue. The manager of this emplo
vivado [14]

The HR department could send the email using the blind copy feature to send it to the manager.

The bcc (blind carbon copy) feature will send a copy of the email to the designated person without the primary recipient knowing that it was sent to them. There is no indication in the email that shows that a message was blind copied.

7 0
3 years ago
Other questions:
  • What does the Autosum feature on excel do?
    15·1 answer
  • Mrs. Golden wanted to collect baseline data on how often Lauren speaks to her neighbors during silent reading. He divided the 15
    9·1 answer
  • To access WordPad, Jill will click on Start, All Programs, Accessories, and WordPad. To access Notepad, Karl will click on Start
    11·1 answer
  • A ___ is the basic collective unit of data in a computer.
    12·1 answer
  • A range in which a measuring instrument or controller does not respond is the
    12·1 answer
  • Which of the following terms are aspect ratios for devices? 'select all that apply
    11·1 answer
  • Choose a film you have watched, or watch a film you have wanted to. Write a film review in at least three paragraphs. Describe w
    5·1 answer
  • Which of the following is best known as a business network LinkedIn, Facebook, Twitter or Word Press?
    15·1 answer
  • What is the reason that friction is present in surface to surface contact?
    5·1 answer
  • A sum amounts to ₹2400 at 15% simple interest per annum after 4 years fond the sum.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!