Question

In: Computer Science

Running on a particular treadmill you burn a specific number of calories per minute. Write a...

Running on a particular treadmill you burn a specific number of calories per minute. Write a python program that uses a loop (you must use a loop) to display the number of minutes (as an integer) it will take to burn greater than or equal to 100 calories. For example (user input indicated in bold):

SAMPLE 1:

How many calcories burned per minute? 54.3
2 minutes

SAMPLE 2:

How many calcories burned per minute? 4.3
24 minutes

SAMPLE 3:

How many calcories burned per minute? 25
4 minutes

HINT:

Keep a counter of the number of minutes elapsed as well as the amount of calories burned. When the calories burned exceed 100, report the number of minutes :)

Solutions

Expert Solution

****************Summary******************

The program for above queation is given below with comments...and output....

Explanation is in comments....

I hope it works for you :) !!!!!!!!!!!!!

Feel free to ask for help in comments......I would be happy to help!

****************Program*****************

#taking float value from user
CalPerMin=float(input("How many calories burned per minute ? :"))

#setting value of minutes and calories to 0
minutes=0
calories=0

#while loop to calculate the minutes
while calories<100:    #run loop until the calories value is less than 100
#increase minutes and calorie by CalPerMin
    calories=calories+CalPerMin  #add calories per minute in calories
    minutes=minutes+1    #increment minutes by 1

#print the minutes took to burn 100 calories    
print(minutes,"minutes")

******************Output*******************


Related Solutions

Running on a particular treadmill you burn a specific number of calories per minute. Write a...
Running on a particular treadmill you burn a specific number of calories per minute. Write a python program that uses a loop (you must use a loop) to display the number of minutes (as an integer) it will take to burn greater than or equal to 100 calories. For example (user input indicated in bold): SAMPLE 1: How many calcories burned per minute? 54.3 2 minutes SAMPLE 2: How many calcories burned per minute? 4.3 24 minutes SAMPLE 3: How...
Calories Burned Running on a particular treadmill, you burn 4 calories per minute. Write a program...
Calories Burned Running on a particular treadmill, you burn 4 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, and 30 minutes. Note the answer should be in assembly language using windows 32 and .586
In 80X86 assembly language Calories Burned Running on a particular treadmill, you burn 4 calories per...
In 80X86 assembly language Calories Burned Running on a particular treadmill, you burn 4 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, and 30 minutes pls show input and output
Why is it surprising that hunter-gatherers burn the same number of calories per day as a...
Why is it surprising that hunter-gatherers burn the same number of calories per day as a sedentary person in a western society?
You have a dataset of the average number of chirps per minute for a sample of...
You have a dataset of the average number of chirps per minute for a sample of 30 crickets. You find that the mean number of chirps per minute is 40 and that the number of chirps per minute has a standard deviation of 5 chirps. You want to test that the mean number of chirps per minute for a cricket is greater than 38 using a significance level of .05. What is the value of your test statistic? Round your...
PREGUNTA 1 Number of hours per week on the treadmill and cholesterol level is an example...
PREGUNTA 1 Number of hours per week on the treadmill and cholesterol level is an example of: A. Positive Correlation B. Negative Correlation C. No Correlation D. None of the above   PREGUNTA 2 Shoe size and IQ is an example of: A. Positive Correlation B. Negative Correlation C. No Correlation D. None of the above PREGUNTA 3 Number of children in the household under the age of 3 and expenditures on diapers is an example of: A. Positive Correlation B....
Thirty-minute workouts of one of the following will lead to burning the following calories. You wish...
Thirty-minute workouts of one of the following will lead to burning the following calories. You wish to test to see if there is a difference in the amount of calories burned from these three activities. Swimming Tennis Cycling 408 415 385 380 485 250 425 450 380 400 420 402 427 530 268 What is the p-value and your conclusion? p value = 0.0098 and conclude fail to reject the null the three activities are identical and tennis tends to...
The activity of a radioactive sample is the number of decays per minute that occur in...
The activity of a radioactive sample is the number of decays per minute that occur in the sample. We measured this by detecting the radiation entering the Geiger tube window. Explain why our readings were actually only a small fraction of the actual activity. Also, why did that not seem to matter in the determination of Barium-137m’s half-life? Refer to either your A vs. t or your ln A vs. t graph in your explanation.
An animal’s maintenance caloric intake is defined as the number of calories per day required to...
An animal’s maintenance caloric intake is defined as the number of calories per day required to maintain its weight at a constant value. We wish to discover whether the median maintenance caloric intake, m, for a population of rats is less than 10g/day. We draw a SRS of 17 rats, feed each rat 10g of dry food per day for30 days, and find that 4 of the rats lost weight, while the rest gained weight. (a) State null and alternative...
The number of arrivals per minute at a bank located in the central business district of...
The number of arrivals per minute at a bank located in the central business district of a large city was recorded over a period of 200​ minutes, with the results shown in the table below. Complete​ (a) through​ (c) to the right. Arrivals Frequency 0 13 1 24 2 48 3 44 4 30 5 20 6 12 7 6 8 3 a. Compute the expected number of arrivals per minute. μ= ​(Type an integer or decimal rounded to three...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT