Question: The purpose of this question is to write a python program (script) to compute lists of equally spaced time values and corresponding heights for a

The purpose of this question is to write a python program (script) to compute lists of equally spaced time values and corresponding heights for a ball thrown straight up into the air. The lists of times and heights are parallel lists, they have the same number of elements and there is a relationship between elements at the same position in the two lists.

Use input to get the initial velocity v0 of the ball in m/s as a float. Use input to get the integer number of intervals. Let the value of gravity G be 9.81 m/s/s. Compute the time duration the ball is in the air as 2*v0/G. Use a for loop and the range function to compute the equally spaced time values and add them to a list of time values. For each time value use equation 1 to compute the corresponding height of the ball. Add the height to the list of heights. Once all the times and heights have been added to the two lists print a heading as shown in the sample run of the program. Use a for loop and the zip function to go through the two lists and print each corresponding time and height in 10 characters positions to 7 decimal places separated by 1 space, one pair of values per line.

() = 0 0.5 t2

output:

Enter the initial velocity in m/s: 2.5

Enter the number of intervals: 16

y(t) = v0*t - 0.5*g*t**2, where v0 is 2.50 m/s

t y(t)

0.0000000 0.0000000

0.0318552 0.0746607

0.0637105 0.1393667

0.0955657 0.1941179

0.1274210 0.2389144

0.1592762 0.2737561

etc....

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!