Homework Help: Questions and Answers: The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source):

Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print (f’ Calories: {calories:.2f} calories’) Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 calories

Answer:

To solve the problem step by step, let’s break it down. The task is to compute the average calories burned based on the provided formula:

# Get user inputs age = int(input()) weight = float(input()) heart_rate = float(input()) time = float(input()) # Calculate calories using the given formula calories = ((age * 0.2757) + (weight * 0.03295) + (heart_rate * 1.0781) - 75.4991) * (time / 8.368) # Output the result formatted to two decimal places print(f'Calories: {calories:.2f} calories')