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
one data is in memory the computer interpets and executeinstructions to process the data into informationA. TrueB. False
lidiya [134]

Answer:

Option A is the correct answer for the above question.

Explanation:

  • The computer is a system that processes the data to produce information. For any computer system when the data is processed then it will form the information.
  • The user gives some instruction to process that can also be called the program. Then the computer takes the instruction and processes the data on behalf of the instruction and for the information because in any system when data is processed it can form the information.
  • The above question says that the computer follows the instruction to process the data to produce the information which is correct as described above. Hence True is the correct answer to the above question.
4 0
3 years ago
When an instruction is sent to the CPU in a binary pattern, how does the CPU know what instruction the pattern means
kozerog [31]

Answer:

When an instruction is sent to the CPU in a binary pattern, how does the CPU know what instruction the pattern means

Explanation:

When the CPU executes the instructions, it interprets the opcode part of the instruction into individual microprograms, containing their microcode equivalents. Just so you know, a full assembly instruction consists of an opcode and any applicable data that goes with it, if required (register names, memory addresses).

The assembly instructions are assembled (turned into their binary equivalent 0s and 1s, or from now on, logic signals). These logic signals are in-turn interpreted by the CPU, and turned into more low-level logic signals which direct the flow of the CPU to execute the particular instruction.

8 0
3 years ago
After reviewing device security you learn that a malicious user in an airport
NARA [144]

Answer:

Sniffing.

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, sniffing, etc.

Sniffing can be defined as a form of cyber attack in which a malicious user gains access to a private network with the intent of finding out what information is stored on the network.

A packet sniffer also known as a packet analyzer, is a computer software or hardware tool that can be used to intercept, log and analyze network traffic and data that passes through a digital network.

Basically, an unauthorized packet sniffer is used to steal user informations.

This ultimately implies that, sniffing typically involves monitoring and capturing internet traffic (data packets) that are transmitted through a private network in real-time by using a sniffing tool, which may either be a hardware or software.

In this scenario, a malicious user in an airport terminal seating area was able to connect wirelessly to a traveling employee's smartphone and downloaded her contact list. Thus, the type of attack that has taken place is referred to as sniffing.

4 0
3 years ago
Which of the following is the correct style tag for having the web page's text be aligned to the right?
uysha [10]

Answer:

B. style=text-align: right

Explanation:

text-align is a CSS property having 5 types of values. Each of values define below.

left - Aligns content to left.

right - Aligns content to right.

center - Centers the content.

justify - Depends on the width of the content, it will align itself to both left and righ

inherit - It specifies the the value of text-align should be taken from parent element.

8 0
3 years ago
Read 2 more answers
Peter has a website that promotes his local vacation rental site. He uses Google Ads to manage his advertising campaign. He's cr
Mkey [24]

Answer:

The attributed reason for the discrepancy is that Conversion tracking is generating duplicate conversions.

4 0
3 years ago
Other questions:
  • WHAT THE DEFINITION OD ENGINEER. No CHEAT
    5·2 answers
  • Which of the following represent advantages of GPL-licensed software? Check all of the boxes that apply It is always free of cos
    12·2 answers
  • Business cards are generally designed so that this item stands out the most.
    8·1 answer
  • How many ways do advertisers determine target audiences ??????
    15·1 answer
  • Copy the skeleton of code below into your answer. Then in the space indicated, add your own code to prompt the user for two numb
    8·1 answer
  • A popular photo editing application provides customers with the option of accessing a web based version through a monthly subscr
    11·1 answer
  • A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive inves
    10·1 answer
  • How many levels of heading tags are allowed in html?
    13·2 answers
  • WHATS YALL FAVORITE GAME WHOEVER GIVES THE BEST ANSWER WINS 200
    13·2 answers
  • Which unit of binary storage has a size that is processor dependent?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!