Question
JAVAorPYTHONorC++ The coefficient of restitution of a ball, a number between 0 and 1, specifies how much energy is conserved when the ball hits a
JAVAorPYTHONorC++
The coefficient of restitution of a ball, a number between 0 and 1, specifies how much energy is conserved when the ball hits a rigid surface. A coefficient of .9, for instance, means a bouncing ball will rise to 90% of its previous height after each bounce. Write a program to input a coefficient of restitution and an initial height in meters, and report how many times a ball bounces when dropped from its initial height before it rises to a height of less than 10 centimeters. Also report the total distance traveled by the ball before this point. See Fig. 3.26. The coefficients of restitution of a tennis ball, basketball, super ball, and softball are .7, .75, .9, and .3, respectively.
Tried:
restitution = eval(input("Enter coefficient of reinstitution: ")) height = eval(input("Enter initial height in meters: ")) bounces = 0 distance = height while(height > 10):
height = height*restitution distance += height*2 bounces += 1
print("Number of bounces: ", bounces) print("Meters traveled: ", distance)
Sample output:
Enter coefficient of restitution: .7 Enter initial height in meters: 8 Number of bounces: 13 Meters traveled: 44.82
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