Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. (25 pts) A ball falls freely from a certain height. After each bounce, it bounces back to half of its original height, then it
2. (25 pts) A ball falls freely from a certain height. After each bounce, it bounces back to half of its original height, then it falls again. Define a function with two arguments, one is the original height, another one is the number of bounces. Print how many meters it bounces after the number of specific landing. Return the total distance the ball traveled. Example: Input: OriginalHeight-100 NumLanding 2 Output Print: after twice bounce, the ball bounces back to 25 meters height. Return: 100+50+50+25-225 (You only need to return "225") Test your function with different combinations of input. You are encouraged to check the input, and try to use keyword raise, to raise errors if the input is illegitimate
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started