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
You have been tracking your exercise routine, which involves running, lifting weights, yoga, and stretching. You want to see wha
Harrizon [31]

The best chart to see the data distribution for the exercise routine would be a pie chart. Using Microsoft Excel, you can input each data point you have for all you exercise routine category, and generate a pie chart which will show you the percentage for each category in comparison to the total.


5 0
3 years ago
Read 2 more answers
The best way to help people in the contemplation stage of change is to:
Lelechka [254]

Answer:

D. Point out the negative consequences of the behavior, so they see that the negative aspects do outweigh the positive aspects​

Explanation:

7 0
2 years ago
Read 2 more answers
Which nation has a command economy
Over [174]

Answer:command economy is a key feature of any communist society. Cuba, North Korea, and the former Soviet Union are examples of countries that have command economies, while China maintained a command economy for decades before transitioning to a mixed economy that features both communistic and capitalistic elements

5 0
3 years ago
Read 2 more answers
The Gramm-Leach-Bliley Act contains a rule that ensures security and confidentiality of customer information, protects against a
ValentinkaMS [17]

Answer:

b. The Safeguards Rule

Explanation:

According to a different source, these are the options that come with this question:

a. The Information Assurance Rule

b. The Safeguards Rule

c. The Safety Rule

d. The Guardian Rule

This rule is called the <em>Safeguards Rule</em>, and it comes from the Gramm–Leach–Bliley Act (GLBA), also known as the Financial Services Modernization Act of 1999. This is an act of Congress signed by President Bill Clinton that removed barriers among banking companies, securities companies and insurance companies. This meant that organizations such as commercial banks, investment banks, securities firms, and insurance companies were able to consolidate.

7 0
3 years ago
Read 2 more answers
What is not a safety practice for working near power lines?
Vesna [10]
Because there is a very likely chance you can get electrocuted which could lead to medical treatment or even death. Also if working near trees or polls or anything that is touching a power line may lead to you being electrocuted.
6 0
3 years ago
Other questions:
  • A content-managed site can be customized _____.
    12·1 answer
  • What is WEB 1.0 to WEB3.0
    11·1 answer
  • Suppose that a is a one-dimensional array of ints with a length of at least 2. Which of the following code fragments successfull
    8·1 answer
  • Which emails go to the draft folder
    5·2 answers
  • List any two different between primary memory and secondary memory.​
    8·2 answers
  • Why do many experts recommand longer time horizonal if you are doing high risk investment
    7·1 answer
  • Juhfvehrfwhedfhwkefhkujhiuyuiyuiyiyh
    6·1 answer
  • Which of the following statements are true about file naming conventions? Check all of the boxes that apply.
    7·2 answers
  • Design an Application called Student Course Management create interface called Student Course add an abstract method called ad C
    10·1 answer
  • 236. A system such as a printer, smart TV, or HVAC controller, typically uses an operating system on what is called a:
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!