Question

In: Computer Science

Write a program to calculate the time to run 5 miles, 10 miles, half marathon, and...

Write a program to calculate the time to run 5 miles, 10 miles, half marathon, and full marathon if you can run at a constant speed. The distance of a half marathon is 13.1 miles and that of a full marathon is 26.2 miles. Report the time in the format of hours and minutes. Your program will prompt for your running speed (mph) as an integer.

Write a program that displays the Olympic rings. Color the rings in the Olympic colors

Both questions are in python

Solutions

Expert Solution

speed = int(input("Enter your running speed(mph): "))

time = 5/speed
hours = int(time)
minutes = int((time - hours) * 60)
print("To run 5 miles it takes " + str(hours) + " hours and " + str(minutes) + " minutes")

time = 10/speed
hours = int(time)
minutes = int((time - hours) * 60)
print("To run 10 miles it takes " + str(hours) + " hours and " + str(minutes) + " minutes")

time = 13.1/speed
hours = int(time)
minutes = int((time - hours) * 60)
print("To run half marathon it takes " + str(hours) + " hours and " + str(minutes) + " minutes")

time = 26.2/speed
hours = int(time)
minutes = int((time - hours) * 60)
print("To run a marathon it takes " + str(hours) + " hours and " + str(minutes) + " minutes")


Related Solutions

Suppose that a category of world class runners are known to run a marathon (26 miles)...
Suppose that a category of world class runners are known to run a marathon (26 miles) in an average of 145 minutes with a standard deviation of 15 minutes. Consider 49 of the races. Let X = the average of the 49 races. Part (a) Give the distribution of X. (Round your standard deviation to two decimal places.) X~   Part (b) Find the probability that the runner will average between 143 and 148 minutes in these 49 marathons. (Round your...
World class marathon runners are known to run that distance (26.2 miles) in an average of...
World class marathon runners are known to run that distance (26.2 miles) in an average of 146 minutes with a standard deviation of 15 minutes. If we sampled a group of world class runners from a particular race, find the probability of the following: **(use 4 decimal places)** a.) The probability that one runner chosen at random finishes the race in less than 140 minutes. b.) The probability that 10 runners chosen at random have an average finish time of...
World class marathon runners are known to run that distance (26.2 miles) in an average of...
World class marathon runners are known to run that distance (26.2 miles) in an average of 146 minutes with a standard deviation of 15 minutes. If we sampled a group of world class runners from a particular race, find the probability of the following: **(use 4 decimal places)** a.) The probability that one runner chosen at random finishes the race in less than 140 minutes. b.) The probability that 10 runners chosen at random have an average finish time of...
World class marathon runners are known to run that distance (26.2 miles) in an average of...
World class marathon runners are known to run that distance (26.2 miles) in an average of 146 minutes with a standard deviation of 14 minutes. If we sampled a group of world class runners from a particular race, find the probability of the following: **(use 4 decimal places)** a.) The probability that one runner chosen at random finishes the race in less than 140 minutes. b.) The probability that 10 runners chosen at random have an average finish time of...
World class marathon runners are known to run that distance (26.2 miles) in an average of...
World class marathon runners are known to run that distance (26.2 miles) in an average of 143 minutes with a standard deviation of 13 minutes. If we sampled a group of world class runners from a particular race, find the probability of the following: **(use 4 decimal places)** a.) The probability that one runner chosen at random finishes the race in less than 137 minutes. b.) The probability that 10 runners chosen at random have an average finish time of...
Suppose that a category of world class runners are known to run a marathon (26 miles)...
Suppose that a category of world class runners are known to run a marathon (26 miles) in an average of 146 minutes with a standard deviation of 12minutes. Consider 49 of the races. Let X = the average of the 49 races. a)Give the distribution of X. (Round your standard deviation to two decimal places.) X~___(___,___) b)Find the probability that the average of the sample will be between 145 and 148 minutes in these 49 marathons. (Round your answer to...
Suppose that a category of world class runners are known to run a marathon (26 miles)...
Suppose that a category of world class runners are known to run a marathon (26 miles) in an average of 141 minutes with a standard deviation of 12 minutes. Consider 49 of the races. Let X = the average of the 49 races. Part (a) Give the distribution of X. (Round your standard deviation to two decimal places.) X ~ , Part (b) Find the probability that the runner will average between 138 and 142 minutes in these 49 marathons....
The amount of time runners take to run a marathon is believed to be uniformly distributed...
The amount of time runners take to run a marathon is believed to be uniformly distributed after running for four hours. The following is the observed number of runners and the length of time it takes to cross the finish line. Carry out the Chi Square Goodness of fit test. Hypothesis: Calculation: Find each expected count and find each chi square value, total value and pvalue. 4-4.5 hours 4.5-5 hours 5-5.5 hours 5.5-6 hours 6-6.5 hours 6.5 + hours Total...
Miles to Kilometers ASSIGNMENT: Write a program to convert miles to kilometers. Put the entire program...
Miles to Kilometers ASSIGNMENT: Write a program to convert miles to kilometers. Put the entire program in a sentinel-controlled loop that runs until the user enters a negative number. Use both a pre-test sentinel-controlled loop and a post-test sentinel-controlled loop in the program. There are 1.6 kilometers in 1.0 mile. Store the value of 1.6 in a constant and use the constant in the calculations. There is 1 blank line after the descriptions, and 2 blanks lines between the pre-test...
write half of page of how spend the free time
write half of page of how spend the free time
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT