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

import math;

#while(1) means loop runs continuously
while(1):
    
    #takes calories burned per minutes from user
    cal_per_min = float(input("How many calcories burned per minute? "))
    
    #calculates minutes required to burn calories greater than or equal to 100
    #math.ceil() will return the ceiling value of the division (100/cal_per_min)
    minute = math.ceil(100 / cal_per_min) ;
    
    #prints minutes
    print(minute , "minutes")
    


Related Solutions

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.
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...
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 25 2 47 3 40 4 32 5 23 6 12 7 6 8 2 Compute the standard deviation. What is the probability that there will be fewer than 2 arrivals in a...
Plamitate uniformly labeled with tritium (3H) to a specific radioactivity of 3.0×·10^8 counts per minute per...
Plamitate uniformly labeled with tritium (3H) to a specific radioactivity of 3.0×·10^8 counts per minute per micromole was added to a mitochondrial preparation that oxidized 3H-palmitate to acetyl-CoA. The experiment calls for hydrolysis of the recovered acetyl-CoA to acetate and determination of the specific radioactivity of the acetate in counts per minute per micromole (cpm/μmol). Assuming that the palmitate is oxidized by the β-oxidation pathway and that there is no unlabeled fatty acid to dilute the tritium, what would be...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT