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
How many instructions can the microprocessor execute each second if the assembly line is present?
SpyIntel [72]

The instructions that he microprocessor can execute each second if the assembly line is present will be depending on the workload and the architecture’s core because it is all depending on the speed of the CPU and the multiplier that it acquires.

3 0
3 years ago
Why would you convert your birth year to binary numbers?
I am Lyosha [343]

Answer:

Write out your birthday in the following format: M/DD/YY. For example, if your birthday is on June 11, 2013, it would be written as 6/11/13.

2. Convert the birthday date to binary format. Using our same example from above, 6/11/13 translated into binary code would be: 110/1011/1101.

3. Select one color of bead to represent “0”, a second color to represent “1” and then the third color to represent a space (/) between the numbers.

4. Layout the beads to represent your birthdate in binary code. Don’t forget the third color for the spaces in between the numbers!

5. Once laid out, string all the beads on to the string or pipe cleaner.

6. Tie a knot around the ends and enjoy your one-of-a kind masterpiece as a piece of jewelry or a bag tag….the options are endless!

6 0
3 years ago
Using Task Manager, you discover an unwanted program that is launched at startup. Of the following items, which ones might lead
Harrizon [31]

Answer: Option (a) ,(c) and (e) can become a solution for the problem.

               Option(b) and (d) are not exactly a solution to the issue rather can    be considered on temporary basis

 

Explanation: Windows Task Manager is used for processing task taking place in the system and monitors the performance of that task or program that is running.To stop the unnecessary program execution on the system. methods like searching the source of the program from Task scheduler, startup files or registry key that initiated the execution that unwanted task.

Methods like disabling the program by using Msconfig and Task manager will only deactivate them but they are not eliminated from the source .Thus the appropriate answers would be option(a), (c) and (e).

7 0
2 years ago
You create a database that stores data in tables that consist of rows and columns. each row has a primary key, and each column h
jeyben [28]
The answer is a relational database.

A data model in database management system consists of rules that define how the DB organizes data. Today, a relational database is widely used. It is a collection of data items organized as a set of formally described tables from which data can be accessed in many different ways.



3 0
3 years ago
Read 2 more answers
5 características de la obsolescencia programada...
snow_lady [41]

Answer:

Obsolescencia programada es cuando un producto está diseñado deliberadamente para tener un tiempo de vida específico. ... Los productos dejan de funcionar al cabo de un tiempo, no porque estén estropeados, sino por que han sido diseñados para fallar al cabo de ese periodo.

Explanation:

espero y esto te pueda ayudar

4 0
3 years ago
Other questions:
  • Which type of programmer designs programs for applications executed on the internet?
    10·1 answer
  • How long does a bankruptcy affect your financial reputation
    13·1 answer
  • Use the following cell phone airport data speeds​ (Mbps) from a particular network. Find P10. 0.1 0.1 0.3 0.3 0.3 0.4 0.4 0.4 0.
    7·1 answer
  • There are six different sequences for the three approval tasks: check inventory; check credit; check special terms.
    5·1 answer
  • When installing EMT conduit that will be exposed to wet conditions, _______ fittings should be used.
    5·2 answers
  • Hello. I have an app which doesn't let me get in. It says: "wrong app info". I'm in a samsung device. How can I solve that probl
    13·2 answers
  • What happens on your screen when you click on the eyedropper tool in Scratch? The background of your scene will become transpare
    7·1 answer
  • SmartArt is a Microsoft Office tool for creating what?
    11·2 answers
  • Please help me on this match all this up i’ll give you brainlist
    13·2 answers
  • consider a pipelined risc cpu with 14 stages. what is maximum speedup of this cpu over a non-pipelined implementation?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!