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
Firdavs [7]
4 years ago
7

The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09

036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for men and women. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('Men: {:.2f} calories'.format(calories_man))
Computers and Technology
1 answer:
sdas [7]4 years ago
8 0

Answer:

// program in Python.

#function to calaculate calories burned

def cal_burned(u_age, u_weight, heart_rate, time, gen):

   #variable

   cal = 0.0

   #for men

   if gen == 'm':

       cal = ((u_age * 0.2017) - (u_weight * 0.09036) + (heart_rate * 0.6309) - 55.0969) * time / 4.184

   #for women

   elif gen == 'f':

       cal = ((u_age * 0.074) - (u_weight * 0.05741) + (heart_rate * 0.4472) - 20.4022) * time / 4.184

#return calories burned

   return cal

#driver function

def main():

   #read age

   u_age=int(input('Enter age (years):'))

   #read weight

   u_weight=float(input('Enter weight (pounds):'))

   #read heart rate

   heart_rate=float(input('Enter heart rate (beats per minute):'))

   #read time

   time = int(input('Enter time (minutes):'))

#call function for Men

   calories_man=cal_burned(u_age,u_weight,heart_rate,time,'m')

#call function for women

   calories_women=cal_burned(u_age,u_weight,heart_rate,time,'f')

#print calories burned for Men

   print('Men: {:.2f} calories'.format(calories_man))

#print calories burned for women

   print('Men: {:.2f} calories'.format(calories_women))

#call main function

main()

Explanation:

Read age, weight, heart rate and time from user.Then call the function cal_burned() with all the input and a character parameter for men.This function will calculate  and return the total calories burned by the men.Similarly call the function again for women, Then it will return the calories burned by women.Print the calories burned by men and women.

Output:

Enter age (years):25                                                                                                      

Enter weight (pounds):180                                                                                                  

Enter heart rate (beats per minute):145                                                                                    

Enter time (minutes):50                                                                                                    

Men: 300.68 calories                                                                                                      

Men: 429.71 calories  

You might be interested in
How to represent derived attributes in database?
Vlad1618 [11]

Answer:

Derived attribute can be defined as a type of attribute where its value will be derived from one or more of the other attributes of the same entity set.

Explanation:

An example of derived attribute is when we have an entity set called General. The set then has attributes like [Form], [Characteristics], [Address}, (Employment No).

(Employment No) which is represented distinctly in the attribute set can be called a derived attribute if it can be derived from one or more of the other attributes.

Derived attribute can be gotten through calculating values and not storing values.

For example, let us consider the following record of Teachers records;

(‘Teacher Number’, ‘Name’, ’Date of Birth’, Age today)

(‘E105’, ‘Samson’, ’07-Dec-1990’, 0)

This record shows that the teacher Samson was born on 7th of December, 1990. At the time of record insertion, he was born and 0 years old. What will be the value of his age on ’07-Dec-2000’? It is about 10 years. It clearly shows that the value is not fixed and it is a variable whenever the DOB is adjusted.

Therefore, we are not creating our table with derived attributes in it. Instead, the values ofderived attributes can be calculated at the time of retrieval and shown to the user. Hence, the record will look like as follows;

(‘E105’, ‘Samson’, ’07-Dec-1990’)

This means that 0 is a derived attribute from the Date of birth.

7 0
3 years ago
Which of the following lines of distribution best describes the diagram?
SashulF [63]
A) retail distribution.
5 0
3 years ago
Read 2 more answers
Which sort has the best big-oh in the best case? Which sort has the best big-oh in the worst case? Which sort does the most swap
evablogger [386]

Answer:

The answer to these questions can be defined as below:

Explanation:

Question 1:

In the best case big-oh the bubble and selection sort is used, where bubble style simply swaps the items, whereas the sort of sorting takes place by choosing the element.

Question 2:

In the worst case, the merge and selection is used, where Merge-sort splits the list into two sub-lists equally and incessantly names itself in the sublists to still be sorted, whereas Heap-sort is an anti-recursive type.  

Question 3:

In the worst case of swapping the bubble sort algorithm is used.

Question 4:

In sorts of swap selection, bubble, and quick sort is used.

Question 5:

Insertion sorts provide the shift sorts.

Question 6:

The best big-oh is o(n), in the worst case, best case complexity of different sorts are different.

6 0
3 years ago
bing bong bing bong bing bong bing bong bing bong bing bong bing bong bing bong bing bong bing bong bing bong bing bong bing bon
Artist 52 [7]

Answer:

Is this free points? bingbongbingbongbingbongbingbongbingbongbingbong hehe have a nice day :)

Explanation:

3 0
3 years ago
Read 2 more answers
. The __________ logical operator works best when testing a number to determine if it
borishaifa [10]

Answer:

The <u>OR</u> logical operator works best when testing a number to determine if it  is outside a range

Explanation:

The answer to this statement is:

The <u>OR</u> logical operator works best when testing a number to determine if it  is outside a range

The concept of logical operators is simple. They allow a program to make a decision based on multiple conditions

The AND (&&) operator is used to determine whether both operands or conditions are true

The NOT (!) operator is used to convert true values to false and false values to true. In other words, it inverts a value

The OR ( || ) operator is used to determine whether either of the conditions is true. If the first operand of the || operator evaluates to true, the second operand will not be evaluated.

3 0
3 years ago
Other questions:
  • You manage the IT department at a small startup Internet advertiser. You need to set up an inexpensive system that allows custom
    14·1 answer
  • C. why do manufacturers offer hard drive diagnostic software? what are the potential benefits of doing so to the manufacturer an
    13·2 answers
  • Word processing software allows users to do which of the following: format text design pages share documents mail merge document
    14·2 answers
  • Which is the best example of online multimedia?
    6·2 answers
  • Osha requires employers pay for most required personal protective equipment including
    11·1 answer
  • In a bluesnooping attack, the attacker copies emails, calendars, contact lists, cell phone pictures, or videos by connecting to
    12·1 answer
  • A small cluster of three countries (China, Malaysia, and Korea) are creating a reputation for this type of outsourcing. a. Farsh
    6·1 answer
  • (10 points) Make a user interface to get 3 points from the user which will be placed on the coordinate plane. Then write a Pytho
    11·1 answer
  • Write a python program to find the volume of the pepsi present in the can which is in the shape of cylinder accepting the radius
    11·2 answers
  • The Windows Net use command is a quick way to discover any shared resources on a computer or server. True or False
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!