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
What software is my teacher using to do this and how can i stop her from doing this
aliina [53]

Answer:

I’m not sure if you can only teachers can acess that

Explanation:

7 0
3 years ago
Read 2 more answers
Consider the following instructions for a game element: Move Forward If not at end, move forward Else stop This is an example of
xz_007 [3.2K]

Answer:

C.

Explanation:

8 0
3 years ago
Plz help me on this one
abruzzese [7]
I can’t see all the answer choices.
8 0
4 years ago
Read 2 more answers
How please help me computer​
Natalka [10]

Answer:

Whaaaaaaaaaaatttttttttttttttt the

Explanation:

7 0
3 years ago
PLEASE HELP ME In one to two sentences, describe how to change your home page.
artcher [175]

Answer:

In the menu bar on the top of your browser, click Tools; select Internet Options and click the General tab. Under "Home page", enter the search engine you would like to change into, confirm it, then restart your browser.

4 0
3 years ago
Other questions:
  • The graphical user interface (GUI) was pioneered in the mid-1970s by researchers at:
    10·2 answers
  • Which of the following types of software is most applicable to the promotion of new products through advertising?
    5·2 answers
  • It is a small hand tool used generally in decorative works such as making garnishes
    15·1 answer
  • Important tools used in the _____ phase of the DMAIC process include a project charter, a description of customer requirements,
    10·1 answer
  • What type of light is commonly used by a plate making unit to expose plates
    8·1 answer
  • Can you give 10 facts about the Victorians please
    9·1 answer
  • give an example of a technical issue you were not able to resolve on your first attempt. What troubleshooting steps did you take
    13·1 answer
  • The use of computer in a modern world is as a result of complexity. true or false
    6·1 answer
  • Pick a web browser (a leading one or perhaps a lesser-known one that you use) and examine the Privacy and Security features and
    10·1 answer
  • When is founded by java
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!