Question

Python Coding Question: Reluctant toddler. A three-year-old has been instructed to go to bed, but he's...

Python Coding Question: Reluctant toddler. A three-year-old has been instructed to go to bed, but he's really not on board. En route to his bedroom, every second he travels only 90% as far as he traveled in the previous second. Write a program that asks the user how many feet the child traveled during the first second (in other words, his initial speed), then reports a) how far he traveled in total after 30 seconds, and b) his speed (in feet per second) during that last second.

As a check, a toddler who starts at 5 ft/s will have traveled about 47.88 ft in 30 seconds; in the last second his speed will be about 0.212 ft/s.

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

#Getting the inputs from Keyboard

speed = float(input('Enter the Initial Speed in Ft/sec '))

seconds = 30

#initialising the total distance with 0

distance = float(0)

#using while loop to calculate the Distance and final speed

while(seconds > 0):

    distance += speed

    speed = speed*0.9

    seconds = seconds-1

# Printing the Results

print('Total Distance after 30 seconds: ',distance,' Feet')

print('Final Speed: ',speed,' Ft/Sec')

Output:

Add a comment
Know the answer?
Add Answer to:
Python Coding Question: Reluctant toddler. A three-year-old has been instructed to go to bed, but he's...
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
  • NUR 254 Pediatric Case Study-Asthma-Student L.S. is a 7-year-old who has been brought to the emergency...

    NUR 254 Pediatric Case Study-Asthma-Student L.S. is a 7-year-old who has been brought to the emergency department (ED) by his mother. She immediately tells you he has a history of ED visits for his asthma. He uses an inhaler when he wheezes, but it ran out a month ago. She is a single parent and has 2 other children at home with a babysitter. Your assessment finds L.S. alert, oriented, and extremely anxious. His color is pale, and his nail...

  • Except for a few pigeons, Central Park was deserted

    Except for a few pigeons, Central Park was deserted. Mist hung above the chilled grass. Patches of old snow, scattered here and there, looked like white puddles. The sun hung just above the horizon, casting red and orange streaks across low-hanging clouds. The portly, gray-haired gentleman jogging down the path looked out of place. For one thing, he was dressed in ordinary street clothes, not a sweat suit. Also, every few seconds, he looked anxiously back over his shoulder. Coming...

  • i really need help with the graphs Driving Can Be Dangerous to Your Health: An Interrupted...

    i really need help with the graphs Driving Can Be Dangerous to Your Health: An Interrupted Case Study in Physiology Phil Stephens Department of Biology Villanova University Part 1-The Grandparents Arrive Dave pulled the cell phone out of his pocket, cursing himself for not putting it on vibrate. The children, Jason and Laura, were both asleep, and he knew that the rest of the day would not be fun if they were awakened from their naps. "Hi, Dave. We're just...

  • Read about Cokes strategy in Africa in the article below and discuss the ethics of selling...

    Read about Cokes strategy in Africa in the article below and discuss the ethics of selling soft drinks to very poor people. Is this an issue that a company like Coke should consider? Africa: Coke's Last Frontier Sales are flat in developed countries. For Coke to keep growing, Africa is it By Duane Stanford Piles of trash are burning outside the Mamakamau Shop in Uthiru, a suburb of Nairobi, Kenya. Sewage trickles by in an open trench. Across the street,...

  •    Available Feb 11 at 12am - Mar 8 at 11:59pm 26 days Not for IV...

       Available Feb 11 at 12am - Mar 8 at 11:59pm 26 days Not for IV Use: The Story of an Enteral Tubing Misconnection The Story of Robin and Addison Lowe (United States) LEARNING OBJECTIVES After completing this case study, you will be able to: 1. Explore the scientific feld of human factors and how errors like tubing misconnections can be prevented. 2. Discuss the complexity of having two patients to treat, a mother and her fetus. 3. Describe suitable...

  • 109 CASE STUDY Dream Desk Compary Dream Desk Company is a major supplier of office desks for can ...

    109 CASE STUDY Dream Desk Compary Dream Desk Company is a major supplier of office desks for can profit from this market growth if prices can be held in line home and business. The company has been in existence since 1875. Affler serving an apprenticeship as a cabinet maker in the and quick delivery can be promised. Dream Desk operates a 250,000 sq. ft. manufacturing fa- cast, George Dreamer had a violent disagreement with the shop eility in Casa Petite,...

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