Question

Python: Practice has just begun for you as a star track athlete . You start out...

Python: Practice has just begun for you as a star track athlete . You start out running "a" miles on day 1, but need to be able to run "b" mile by your big track meet. Calculate how many days you will need for you to reach the required distance for your big meet, given that you increase your running distance by 5 percent each day from the day before. Return one value that represents the number of days to reach that goal.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def run(a, b):
days = 0
total = 0
#run until total is less than miles needed to run(b)
while(total < b):
#running 'a' number of miles.
total += a
days += 1
#updating value of a
a = a + (a*0.05)

return days

b = float(input("Enter the number of miles to complete before the meet: "))
a = float(input("Enter the number of miles completed in day 1: "))

print("Number of days to complete", b, "miles in ", run(a, b), "days.")

If there is anything that you do not unserstand, or need more help then please mention it in the comments section.

Add a comment
Know the answer?
Add Answer to:
Python: Practice has just begun for you as a star track athlete . You start out...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How to Prepare for a 5- Kilometer Race Preparing to run in a 5- kilometer race...

    How to Prepare for a 5- Kilometer Race Preparing to run in a 5- kilometer race needs to begin 8 weeks before the scheduled day of the race. The first and most important thing to do is to check with your doctor to make sure you are healthy enough to run in a 5- kilometer race. Establish a Running Plan A 5-kilometer race is a little over 3 miles long. It is best to start by running a shorter distance...

  • Establisha Running Plan. a long to start You running n g plan to ensure Week 5...

    Establisha Running Plan. a long to start You running n g plan to ensure Week 5 Week 7 Wees We nghardance distance. This chart will help you you are ready for race day Week 3 Week We Week 1 Week 1 mile 1 miles 1 miles The following questions are based this maga magazine clipping 29. Which week show the great reatest increase in distance over the previous week? a Week 2 and 4 b. Week 3 and 6 c....

  • Once you graduate college and start working, you expect that you'll be able to save $6...

    Once you graduate college and start working, you expect that you'll be able to save $6 thousand every year at the start of each year, an amount that will grow with inflation. Inflation is anticipated to be 2% per year. You think you will need $1 million of invested assets, as measured in today's purchasing power, in order to reach financial independence. You also anticipate an average nominal rate of return on your investment of 8.4%. How long will it...

  • You just graduated from college and decide to start saving for a down payment to buy...

    You just graduated from college and decide to start saving for a down payment to buy a house 5 years from today. You estimate you will need $20,000 in 5 years for the down payment. (Note: a down payment is a deposit a home buyer must make in order to get a mortgage loan from a bank to buy the house.) 3a. Assume you can earn 6% interest (APR) on your savings, and you make a deposit in your savings...

  • You just graduated from college and decide to start saving for a down payment to buy a house 5 years from today. You est...

    You just graduated from college and decide to start saving for a down payment to buy a house 5 years from today. You estimate you will need $20,000 in 5 years for the down payment. (Note: a down payment is a deposit a home buyer must make in order to get a mortgage loan from a bank to buy the house.) 1. Assume you can earn 6% interest (APR) on your savings, and you want to make a single deposit...

  • use python to write You want to figure out how many days you spent in your...

    use python to write You want to figure out how many days you spent in your highschool education. Assign the start and the end year for your highschool studies (or you can make up two years that are at least 2-4 years apart). For simplicity, we will not worry about the months or the actual dates. Write a program that will display how many days you had in that range (inclusive of both the years). For example, if you started...

  • You have decided that 20 years after the day you start working full time you will take a leave of absence for avocation...

    You have decided that 20 years after the day you start working full time you will take a leave of absence for avocation around the world. To save money for this vacation, you found an investment that pays 4% nominal interest, compounded annually, and you believe you need $150,000 in that account when you take your trip. You will make end of year deposits every year for the 20 years while working (including the end of your 20th year), and...

  • please answer #29, #30, and #31 correctly. is #29 week 3 and 7 or week 2...

    please answer #29, #30, and #31 correctly. is #29 week 3 and 7 or week 2 and 5??? Establish a Running Plan A 5-kilometer race is a little over 3 miles long. It is best to start by running a shorter distance and then gradually increase your running distance. This chart will help you to establish a running plan to ensure you are ready for race day. Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week...

  • I am writing a Python program to serve as a fitness tracker. I would love some...

    I am writing a Python program to serve as a fitness tracker. I would love some input as to how you would code this. I've included what I want this program to accomplish, what I will keep track of, and below all of that I have posted the assignment guidelines. Any suggestions on how to make this better/ more efficient would be welcome! I'm thinking of making a weekly tracker that takes input per day, and outputs at the end...

  • Please read the following case study and answer the following questions. After answering the questions, please...

    Please read the following case study and answer the following questions. After answering the questions, please respond to at least 2 classmates- either adding onto their thoughts/ideas or providing them with feedback. DO NOT JUST WRITE: I AGREE. When I first started exercising, I really dreaded doing it. I was 50 pounds overweight, and I would run out of breath just trying to walk to the end of the block. But I was determined to stop being a couch potato...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT