Functions: Falling Distance
When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = ½* g*t2 And the velocity of the object falling is calculated as v=g*t
The variables in the formula are as follows:
- d is the distance in meter,
- g is 9.8, gravity acceleration constant in m/s2,
- t is the amount of time, in seconds, that the object has been falling.
- v is the velocity of the object in m/s
So for instance, you’re standing at the edge of a cliff and drop a ball. It takes 10 sec to hit the ground. How high up are you? And what was the velocity of the ball?
Write two functions:
- a function named falling_distance that accepts an object’s falling time (in seconds) as an argument.
- a function names falling_velocity that accepts an object’s falling time (in seconds) as an argument.
- you should round your d and v up to two decimals inside your functions.
The function should return the distance, in meter, and velocity in m/s for the object has fallen during that time interval. Also print the put put in f-print style.
Example: The falling distance for an object to have a free fall for 10 second is 490.0 meter. It’s falling velocity will be 98.0 m/s.
Write a program that calls the function in a loop that passes the values 1 through 10 as arguments and displays the return values.