Running on a particular treadmill you burn 4.2 calories per minute. Write a program that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. Reminder: the escape character \t is equivalent to a tabspace.

Respuesta :

Answer:

# for loop that loop from 10 to 35

# the values of i will be 10, 15, 20, 25, 30

# 4.2 calories is burn per minute; so we multiply by the number of minutes

# the calories burn is displayed to the user

for i in range(10, 35, 5):

   print("You burn", i * 4.2, " calories in ", i, "minutes"

Explanation:

The program is written in Python and it is well commented. A program output of when the code is executed is attached.

Ver imagen ibnahmadbello

The program illustrates the use of loops

Loops are statements that perform repetitive operations

The program in Python where comments are used to explain each line is as follows:

#This prints the output header

print("Time\tCalory")

#This iterates from 10 to 30, with an increment of 5

for i in range(10, 31, 5):

   #This prints the calories burnt every 5 minutes

   print(i,"\t", i * 4.2)

Read more about loops at:

https://brainly.com/question/4261753