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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!